summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-13 19:03:18 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-13 19:03:18 -0700
commit6fdab32e14e2bca05ae6471502bcdfd35b381564 (patch)
tree8c7848ed8e747b74b709f49ba6dd0c2fbf274238
parentMerge branch 'nd/maint-sparse-errors' (diff)
parentgrep --no-index: don't use git standard exclusions (diff)
downloadtgif-6fdab32e14e2bca05ae6471502bcdfd35b381564.tar.xz
Merge branch 'bw/grep-no-index-no-exclude'
* bw/grep-no-index-no-exclude: grep --no-index: don't use git standard exclusions grep: do not use --index in the short usage output
-rw-r--r--builtin/grep.c6
-rwxr-xr-xt/t7810-grep.sh2
2 files changed, 4 insertions, 4 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index a286692e46..91c3a852f6 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -646,7 +646,6 @@ static int grep_directory(struct grep_opt *opt, const struct pathspec *pathspec)
int i, hit = 0;
memset(&dir, 0, sizeof(dir));
- setup_standard_excludes(&dir);
fill_directory(&dir, pathspec->raw);
for (i = 0; i < dir.nr; i++) {
@@ -777,8 +776,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
struct option options[] = {
OPT_BOOLEAN(0, "cached", &cached,
"search in index instead of in the work tree"),
- OPT_BOOLEAN(0, "index", &use_index,
- "--no-index finds in contents not managed by git"),
+ { OPTION_BOOLEAN, 0, "index", &use_index, NULL,
+ "finds in contents not managed by git",
+ PARSE_OPT_NOARG | PARSE_OPT_NEGHELP },
OPT_GROUP(""),
OPT_BOOLEAN('v', "invert-match", &opt.invert,
"show non-matching lines"),
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 0d600163c8..4a05e79cae 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -554,7 +554,6 @@ test_expect_success 'outside of git repository' '
mkdir -p non/git/sub &&
echo hello >non/git/file1 &&
echo world >non/git/sub/file2 &&
- echo ".*o*" >non/git/.gitignore &&
{
echo file1:hello &&
echo sub/file2:world
@@ -581,6 +580,7 @@ test_expect_success 'inside git repository but with --no-index' '
echo world >is/git/sub/file2 &&
echo ".*o*" >is/git/.gitignore &&
{
+ echo ".gitignore:.*o*" &&
echo file1:hello &&
echo sub/file2:world
} >is/expect.full &&