summaryrefslogtreecommitdiff
path: root/t/t1501-worktree.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2008-08-28 13:04:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-29 05:46:16 (GMT)
commit6577f542b3ab64594c7d7a7db752e96be7234fb0 (patch)
tree2632bcaa41c70b3e1192739c95e6433d35ac9f33 /t/t1501-worktree.sh
parent4f38f6b5bafb1f7f85c7b54d0bb0a0e977cd947c (diff)
downloadgit-6577f542b3ab64594c7d7a7db752e96be7234fb0.zip
git-6577f542b3ab64594c7d7a7db752e96be7234fb0.tar.gz
git-6577f542b3ab64594c7d7a7db752e96be7234fb0.tar.bz2
grep: fix worktree setup
Unless used with --cached or grepping on a tree, "git grep" will search on working directory, so set up worktree properly Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1501-worktree.sh')
-rwxr-xr-xt/t1501-worktree.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index 8244b3a..c039ee3 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -169,4 +169,9 @@ test_expect_success 'git diff' '
test_cmp diff-FILES.expected result
'
+test_expect_success 'git grep' '
+ (cd repo.git/work/sub &&
+ GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep -q dir/tracked)
+'
+
test_done