Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> --- Makefile | 2 +- t/helper/test-subprocess.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t1501-work-tree.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c1dc9ff8d6..893ea64ca2 100644 --- a/Makefile +++ b/Makefile @@ -683,6 +683,7 @@ TEST_BUILTINS_OBJS += test-sigchain.o TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_BUILTINS_OBJS += test-string-list.o TEST_BUILTINS_OBJS += test-submodule-config.o +TEST_BUILTINS_OBJS += test-subprocess.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache @@ -690,7 +691,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh TEST_PROGRAMS_NEED_X += test-line-buffer TEST_PROGRAMS_NEED_X += test-parse-options TEST_PROGRAMS_NEED_X += test-write-cache -TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool TEST_PROGRAMS_NEED_X += test-urlmatch-normalization diff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c index 30c5765bfc..2699257663 100644 --- a/t/helper/test-subprocess.c +++ b/t/helper/test-subprocess.c @@ -1,7 +1,8 @@ +#include "test-tool.h" #include "cache.h" #include "run-command.h" -int cmd_main(int argc, const char **argv) +int test_subprocess(int argc, const char **argv) { struct child_process cp = CHILD_PROCESS_INIT; int nogit = 0; diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 1b95f1b30b..49f4d6f901 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -38,6 +38,7 @@ static struct test_cmd cmds[] = { { "strcmp-offset", test_strcmp_offset }, { "string-list", test_string_list }, { "submodule-config", test_submodule_config }, + { "subprocess", test_subprocess }, }; int cmd_main(int argc, const char **argv) diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h index 16a05993e5..eaf15cbd84 100644 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@ -32,5 +32,6 @@ int test_sigchain(int argc, const char **argv); int test_strcmp_offset(int argc, const char **argv); int test_string_list(int argc, const char **argv); int test_submodule_config(int argc, const char **argv); +int test_subprocess(int argc, const char **argv); #endif diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh index b07cb9140e..02cf2013fc 100755 --- a/t/t1501-work-tree.sh +++ b/t/t1501-work-tree.sh @@ -341,7 +341,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' ' test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' ' GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \ - test-subprocess --setup-work-tree rev-parse --show-toplevel >actual && + test-tool subprocess --setup-work-tree rev-parse --show-toplevel >actual && echo "$(pwd)/repo.git/work" >expected && test_cmp expected actual ' -- 2.16.2.903.gd04caf5039