Merge branch 'nd/worktree' into maint
* nd/worktree: setup_git_directory(): fix move to worktree toplevel directory update-index: fix worktree setup read-tree: setup worktree if merge is required grep: fix worktree setup diff*: fix worktree setup
This commit is contained in:
@ -783,8 +783,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||
paths[1] = NULL;
|
||||
}
|
||||
|
||||
if (!list.nr)
|
||||
if (!list.nr) {
|
||||
if (!cached)
|
||||
setup_work_tree();
|
||||
return !grep_cache(&opt, paths, cached);
|
||||
}
|
||||
|
||||
if (cached)
|
||||
die("both --cached and trees are given.");
|
||||
|
||||
Reference in New Issue
Block a user