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>
This commit is contained in:
parent
ae299be0e5
commit
d553e73789
1
.gitignore
vendored
1
.gitignore
vendored
@ -142,7 +142,6 @@ git-write-tree
|
|||||||
git-core-*/?*
|
git-core-*/?*
|
||||||
gitk-wish
|
gitk-wish
|
||||||
gitweb/gitweb.cgi
|
gitweb/gitweb.cgi
|
||||||
test-absolute-path
|
|
||||||
test-chmtime
|
test-chmtime
|
||||||
test-date
|
test-date
|
||||||
test-delta
|
test-delta
|
||||||
|
2
Makefile
2
Makefile
@ -1186,7 +1186,7 @@ endif
|
|||||||
|
|
||||||
### Testing rules
|
### 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)
|
all:: $(TEST_PROGRAMS)
|
||||||
|
|
||||||
|
@ -301,14 +301,14 @@ test_expect_success 'absolute path works as expected' '
|
|||||||
mkdir third &&
|
mkdir third &&
|
||||||
dir="$(cd .git; pwd -P)" &&
|
dir="$(cd .git; pwd -P)" &&
|
||||||
dir2=third/../second/other/.git &&
|
dir2=third/../second/other/.git &&
|
||||||
test "$dir" = "$(test-absolute-path $dir2)" &&
|
test "$dir" = "$(test-path-utils make_absolute_path $dir2)" &&
|
||||||
file="$dir"/index &&
|
file="$dir"/index &&
|
||||||
test "$file" = "$(test-absolute-path $dir2/index)" &&
|
test "$file" = "$(test-path-utils make_absolute_path $dir2/index)" &&
|
||||||
basename=blub &&
|
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 &&
|
ln -s ../first/file .git/syml &&
|
||||||
sym="$(cd first; pwd -P)"/file &&
|
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' '
|
test_expect_success 'very long name in the index handled sanely' '
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -9,5 +9,13 @@ int main(int argc, char **argv)
|
|||||||
puts(buf);
|
puts(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc >= 2 && !strcmp(argv[1], "make_absolute_path")) {
|
||||||
|
while (argc > 2) {
|
||||||
|
puts(make_absolute_path(argv[2]));
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user