aboutsummaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-31 16:23:31 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-31 16:23:31 -0700
commit633142d86874ee8ce79a23ee4346f32e6271faad (patch)
tree8096e26f84075d3aae42d13fe0b76c2a5f2ea07c /builtin/grep.c
parent693fefe3d022767975eec7585561bfe178b873f4 (diff)
parent41bf3bc232cf5f99fdc6d3d729536a4c4821d3bd (diff)
downloadgit-633142d86874ee8ce79a23ee4346f32e6271faad.tar.gz
git-633142d86874ee8ce79a23ee4346f32e6271faad.tar.xz
Merge branch 'jn/paginate-fix'
* jn/paginate-fix: t7006 (pager): add missing TTY prerequisites merge-file: run setup_git_directory_gently() sooner var: run setup_git_directory_gently() sooner ls-remote: run setup_git_directory_gently() sooner index-pack: run setup_git_directory_gently() sooner config: run setup_git_directory_gently() sooner bundle: run setup_git_directory_gently() sooner apply: run setup_git_directory_gently() sooner grep: run setup_git_directory_gently() sooner shortlog: run setup_git_directory_gently() sooner git wrapper: allow setup_git_directory_gently() be called earlier setup: remember whether repository was found git wrapper: introduce startup_info struct Conflicts: builtin/index-pack.c
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index b725ede0f..da32f3df3 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -839,7 +839,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
struct string_list path_list = STRING_LIST_INIT_NODUP;
int i;
int dummy;
- int nongit = 0, use_index = 1;
+ int use_index = 1;
struct option options[] = {
OPT_BOOLEAN(0, "cached", &cached,
"search in index instead of in the work tree"),
@@ -930,8 +930,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_END()
};
- prefix = setup_git_directory_gently(&nongit);
-
/*
* 'git grep -h', unlike 'git grep -h <pattern>', is a request
* to show usage information and exit.
@@ -976,7 +974,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
PARSE_OPT_STOP_AT_NON_OPTION |
PARSE_OPT_NO_INTERNAL_HELP);
- if (use_index && nongit)
+ if (use_index && !startup_info->have_repository)
/* die the same way as if we did it at the beginning */
setup_git_directory();