summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae299be)
raw | patch | inline | side by side (parent: ae299be)
author | David Reiss <dreiss@facebook.com> | |
Tue, 20 May 2008 06:49:00 +0000 (23:49 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 23 May 2008 21:15:01 +0000 (14:15 -0700) |
Signed-off-by: David Reiss <dreiss@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitignore | patch | blob | history | |
Makefile | patch | blob | history | |
t/t0000-basic.sh | patch | blob | history | |
test-absolute-path.c | [deleted file] | patch | blob | history |
test-path-utils.c | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index c54c473e94f247823487f91d327dcf7a2dcd5b19..31ea9f13bad95866a8069566602573a4c2a5c258 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-core-*/?*
gitk-wish
gitweb/gitweb.cgi
-test-absolute-path
test-chmtime
test-date
test-delta
diff --git a/Makefile b/Makefile
index ada85686eafc6863357a884691bb62b1e060b194..c1903b68a8b52867fc5f61cef2c6aa039fc11c19 100644 (file)
--- a/Makefile
+++ b/Makefile
### Testing rules
-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
+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
all:: $(TEST_PROGRAMS)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 690f80ab27fd9ff6d7e145a86eb22c6f87e3cd76..d7cbc5c6dae538fe8c053a2f3760502422615e2c 100755 (executable)
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
mkdir third &&
dir="$(cd .git; pwd -P)" &&
dir2=third/../second/other/.git &&
- test "$dir" = "$(test-absolute-path $dir2)" &&
+ test "$dir" = "$(test-path-utils make_absolute_path $dir2)" &&
file="$dir"/index &&
- test "$file" = "$(test-absolute-path $dir2/index)" &&
+ test "$file" = "$(test-path-utils make_absolute_path $dir2/index)" &&
basename=blub &&
- test "$dir/$basename" = "$(cd .git && test-absolute-path "$basename")" &&
+ test "$dir/$basename" = "$(cd .git && test-path-utils make_absolute_path "$basename")" &&
ln -s ../first/file .git/syml &&
sym="$(cd first; pwd -P)"/file &&
- test "$sym" = "$(test-absolute-path "$dir2/syml")"
+ test "$sym" = "$(test-path-utils make_absolute_path "$dir2/syml")"
'
test_expect_success 'very long name in the index handled sanely' '
diff --git a/test-absolute-path.c b/test-absolute-path.c
--- a/test-absolute-path.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "cache.h"
-
-int main(int argc, char **argv)
-{
- while (argc > 1) {
- puts(make_absolute_path(argv[1]));
- argc--;
- argv++;
- }
- return 0;
-}
diff --git a/test-path-utils.c b/test-path-utils.c
index 1bd43216f66b7e9395fa343fa174c826e41da3d7..842b58018f7efebf7f92cee117d1a0b50297a12e 100644 (file)
--- a/test-path-utils.c
+++ b/test-path-utils.c
puts(buf);
}
+ if (argc >= 2 && !strcmp(argv[1], "make_absolute_path")) {
+ while (argc > 2) {
+ puts(make_absolute_path(argv[2]));
+ argc--;
+ argv++;
+ }
+ }
+
return 0;
}