summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd83ac4)
raw | patch | inline | side by side (parent: cd83ac4)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 4 Jan 2010 12:34:15 +0000 (19:34 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 7 Jan 2010 02:29:23 +0000 (18:29 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c | patch | blob | history | |
t/t7002-grep.sh | patch | blob | history |
diff --git a/builtin-grep.c b/builtin-grep.c
index 25ee75d989d80382e370b5460f3d8f64ae086f6e..04ac60a29a55189d2c757a0a205b4cc0e7ece9da 100644 (file)
--- a/builtin-grep.c
+++ b/builtin-grep.c
int status;
argv[argc] = NULL;
+ trace_argv_printf(argv, "trace: grep:");
pid = fork();
if (pid < 0)
return pid;
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index 23eeb767f97d9640c44e48d396d1b76afb0fa5b9..99142fd6bda0e9c241bad1c18a18583b30fda700 100755 (executable)
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
test_cmp expected actual
'
+test_expect_success EXTGREP 'external grep is called' '
+ GIT_TRACE=2 git grep foo >/dev/null 2>actual &&
+ grep "trace: grep:.*foo" actual >/dev/null
+'
+
+test_expect_success EXTGREP 'no external grep when skip-worktree entries exist' '
+ git update-index --skip-worktree file &&
+ GIT_TRACE=2 git grep foo >/dev/null 2>actual &&
+ ! grep "trace: grep:" actual >/dev/null &&
+ git update-index --no-skip-worktree file
+'
+
test_done