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:
Junio C Hamano
2008-09-03 15:35:37 -07:00
8 changed files with 81 additions and 4 deletions

View File

@ -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.");