Merge branch 'tg/diff-no-index-refactor'

"git diff ../else/where/A ../else/where/B" when ../else/where is
clearly outside the repository, and "git diff --no-index A B", do
not have to look at the index at all, but we used to read the index
unconditionally.

* tg/diff-no-index-refactor:
  diff: avoid some nesting
  diff: add test for --no-index executed outside repo
  diff: don't read index when --no-index is given
  diff: move no-index detection to builtin/diff.c
This commit is contained in:
Junio C Hamano
2013-12-27 14:58:17 -08:00
5 changed files with 103 additions and 49 deletions

2
diff.h
View File

@ -332,7 +332,7 @@ extern int diff_flush_patch_id(struct diff_options *, unsigned char *);
extern int diff_result_code(struct diff_options *, int);
extern void diff_no_index(struct rev_info *, int, const char **, int, const char *);
extern void diff_no_index(struct rev_info *, int, const char **, const char *);
extern int index_differs_from(const char *def, int diff_flags);