From: Junio C Hamano Date: Fri, 27 Dec 2013 22:58:17 +0000 (-0800) Subject: Merge branch 'tg/diff-no-index-refactor' X-Git-Tag: v1.9-rc0~49 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/73b063130befa7475316a142343de87da61f31e3?ds=inline;hp=--cc 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 --- 73b063130befa7475316a142343de87da61f31e3 diff --cc builtin/diff.c index fe0cc7f1b5,24d6271625..0f247d2400 --- a/builtin/diff.c +++ b/builtin/diff.c @@@ -258,8 -258,9 +261,8 @@@ int cmd_diff(int argc, const char **arg struct rev_info rev; struct object_array ent = OBJECT_ARRAY_INIT; int blobs = 0, paths = 0; - const char *path = NULL; struct blobinfo blob[2]; - int nongit; + int nongit = 0, no_index = 0; int result = 0; /*