@matheusbsbs / matheus-bagliano / commits / d553e73789
Fork 0

Fold test-absolute-path into test-path-utils

Signed-off-by: David Reiss <dreiss@facebook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Reiss committed May 19, 2008 at 23:49 UTC d553e737897e8edbbc2092bf345fc58b2dae5251
5 files changed +13 -17
.gitignore
-1
@@ -142,7 +142,6 @@ git-write-tree
142 git-core-*/?*
143 gitk-wish
144 gitweb/gitweb.cgi
145 -test-absolute-path
145 test-chmtime
146 test-date
147 test-delta
Makefile
+1 -1
@@ -1186,7 +1186,7 @@ endif
1186
1187 ### Testing rules
1188
1189 -TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X test-parse-options$X test-path-utils$X
1189 +TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-parse-options$X test-path-utils$X
1190
1191 all:: $(TEST_PROGRAMS)
1192
t/t0000-basic.sh
+4 -4
@@ -301,14 +301,14 @@ test_expect_success 'absolute path works as expected' '
301 mkdir third &&
302 dir="$(cd .git; pwd -P)" &&
303 dir2=third/../second/other/.git &&
304 - test "$dir" = "$(test-absolute-path $dir2)" &&
304 + test "$dir" = "$(test-path-utils make_absolute_path $dir2)" &&
305 file="$dir"/index &&
306 - test "$file" = "$(test-absolute-path $dir2/index)" &&
306 + test "$file" = "$(test-path-utils make_absolute_path $dir2/index)" &&
307 basename=blub &&
308 - test "$dir/$basename" = "$(cd .git && test-absolute-path "$basename")" &&
308 + test "$dir/$basename" = "$(cd .git && test-path-utils make_absolute_path "$basename")" &&
309 ln -s ../first/file .git/syml &&
310 sym="$(cd first; pwd -P)"/file &&
311 - test "$sym" = "$(test-absolute-path "$dir2/syml")"
311 + test "$sym" = "$(test-path-utils make_absolute_path "$dir2/syml")"
312 '
313
314 test_expect_success 'very long name in the index handled sanely' '
test-absolute-path.c deleted
-11
@@ -1,11 +0,0 @@
1 -#include "cache.h"
2 -
3 -int main(int argc, char **argv)
4 -{
5 - while (argc > 1) {
6 - puts(make_absolute_path(argv[1]));
7 - argc--;
8 - argv++;
9 - }
10 - return 0;
11 -}
test-path-utils.c
+8
@@ -9,5 +9,13 @@ int main(int argc, char **argv)
9 puts(buf);
10 }
11
12 + if (argc >= 2 && !strcmp(argv[1], "make_absolute_path")) {
13 + while (argc > 2) {
14 + puts(make_absolute_path(argv[2]));
15 + argc--;
16 + argv++;
17 + }
18 + }
19 +
20 return 0;
21 }