{"thread":{"id":"13583","subject":"[PATCH 2/4] Fold test-absolute-path into test-path-utils","startedAt":"2008-05-20T06:49:00Z","lastAt":"2008-05-20T06:49:00Z","messageCount":1,"participants":["David Reiss"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"77308","messageId":"4832745C.7030709@facebook.com","threadId":"13583","inReplyTo":null,"subject":"[PATCH 2/4] Fold test-absolute-path into test-path-utils","fromName":"David Reiss","fromEmail":"dreiss@facebook.com","sentAt":"2008-05-20T06:49:00Z","receivedAt":"2008-05-20T06:49:00Z","isPatch":true,"sender":{"key":"dreiss@facebook.com","avatar":null},"body":"Signed-off-by: David Reiss <dreiss@facebook.com>\n---\nCompletely unnecessary.  I just thought it might be nice to combine these\nto cut down on the number of test driver functions.\n\n .gitignore           |    1 -\n Makefile             |    2 +-\n t/t0000-basic.sh     |    8 ++++----\n test-absolute-path.c |   11 -----------\n test-path-utils.c    |    8 ++++++++\n 5 files changed, 13 insertions(+), 17 deletions(-)\n delete mode 100644 test-absolute-path.c\n\ndiff --git a/.gitignore b/.gitignore\nindex c54c473..31ea9f1 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -142,7 +142,6 @@ git-write-tree\n git-core-*/?*\n gitk-wish\n gitweb/gitweb.cgi\n-test-absolute-path\n test-chmtime\n test-date\n test-delta\ndiff --git a/Makefile b/Makefile\nindex d76c16b..cda7ab1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1182,7 +1182,7 @@ endif\n \n ### Testing rules\n \n-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\n+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\n \n all:: $(TEST_PROGRAMS)\n \ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 27b54cb..9745f25 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -301,14 +301,14 @@ test_expect_success 'absolute path works as expected' '\n \tmkdir third &&\n \tdir=\"$(cd .git; pwd -P)\" &&\n \tdir2=third/../second/other/.git &&\n-\ttest \"$dir\" = \"$(test-absolute-path $dir2)\" &&\n+\ttest \"$dir\" = \"$(test-path-utils make_absolute_path $dir2)\" &&\n \tfile=\"$dir\"/index &&\n-\ttest \"$file\" = \"$(test-absolute-path $dir2/index)\" &&\n+\ttest \"$file\" = \"$(test-path-utils make_absolute_path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = $(cd .git && test-absolute-path $basename) &&\n+\ttest \"$dir/$basename\" = $(cd .git && test-path-utils make_absolute_path $basename) &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-absolute-path $dir2/syml)\"\n+\ttest \"$sym\" = \"$(test-path-utils make_absolute_path $dir2/syml)\"\n '\n \n test_expect_success 'very long name in the index handled sanely' '\ndiff --git a/test-absolute-path.c b/test-absolute-path.c\ndeleted file mode 100644\nindex c959ea2..0000000\n--- a/test-absolute-path.c\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#include \"cache.h\"\n-\n-int main(int argc, char **argv)\n-{\n-\twhile (argc > 1) {\n-\t\tputs(make_absolute_path(argv[1]));\n-\t\targc--;\n-\t\targv++;\n-\t}\n-\treturn 0;\n-}\ndiff --git a/test-path-utils.c b/test-path-utils.c\nindex 1bd4321..842b580 100644\n--- a/test-path-utils.c\n+++ b/test-path-utils.c\n@@ -9,5 +9,13 @@ int main(int argc, char **argv)\n \t\tputs(buf);\n \t}\n \n+\tif (argc >= 2 && !strcmp(argv[1], \"make_absolute_path\")) {\n+\t\twhile (argc > 2) {\n+\t\t\tputs(make_absolute_path(argv[2]));\n+\t\t\targc--;\n+\t\t\targv++;\n+\t\t}\n+\t}\n+\n \treturn 0;\n }\n-- \n1.5.4\n"}]}