]> git.ipfire.org Git - thirdparty/git.git/blame - builtin/diff.c
Merge branch 'pb/ref-filter-with-crlf'
[thirdparty/git.git] / builtin / diff.c
CommitLineData
65056021
JH
1/*
2 * Builtin "git diff"
3 *
4 * Copyright (c) 2006 Junio C Hamano
5 */
f8adbec9 6#define USE_THE_INDEX_COMPATIBILITY_MACROS
65056021 7#include "cache.h"
b2141fc1 8#include "config.h"
8bfcb3a6 9#include "ewah/ewok.h"
697cc8ef 10#include "lockfile.h"
6b2f2d98 11#include "color.h"
65056021
JH
12#include "commit.h"
13#include "blob.h"
14#include "tag.h"
15#include "diff.h"
16#include "diffcore.h"
17#include "revision.h"
18#include "log-tree.h"
19#include "builtin.h"
302ad7a9 20#include "submodule.h"
fe299ec5 21#include "oid-array.h"
65056021 22
470faf96
TG
23#define DIFF_NO_INDEX_EXPLICIT 1
24#define DIFF_NO_INDEX_IMPLICIT 2
25
65056021 26static const char builtin_diff_usage[] =
b7e10b2c
CT
27"git diff [<options>] [<commit>] [--] [<path>...]\n"
28" or: git diff [<options>] --cached [<commit>] [--] [<path>...]\n"
3d09c228 29" or: git diff [<options>] <commit> [--merge-base] [<commit>...] <commit> [--] [<path>...]\n"
b7e10b2c
CT
30" or: git diff [<options>] <commit>...<commit>] [--] [<path>...]\n"
31" or: git diff [<options>] <blob> <blob>]\n"
32" or: git diff [<options>] --no-index [--] <path> <path>]\n"
33COMMON_DIFF_OPTIONS_HELP;
65056021 34
158b06ca
JK
35static const char *blob_path(struct object_array_entry *entry)
36{
37 return entry->path ? entry->path : entry->name;
38}
39
65056021
JH
40static void stuff_change(struct diff_options *opt,
41 unsigned old_mode, unsigned new_mode,
9c4b0f66 42 const struct object_id *old_oid,
43 const struct object_id *new_oid,
44 int old_oid_valid,
45 int new_oid_valid,
d04ec74b
JK
46 const char *old_path,
47 const char *new_path)
65056021
JH
48{
49 struct diff_filespec *one, *two;
50
9c4b0f66 51 if (!is_null_oid(old_oid) && !is_null_oid(new_oid) &&
4a7e27e9 52 oideq(old_oid, new_oid) && (old_mode == new_mode))
65056021
JH
53 return;
54
0d1e0e78 55 if (opt->flags.reverse_diff) {
35d803bc 56 SWAP(old_mode, new_mode);
9c4b0f66 57 SWAP(old_oid, new_oid);
d04ec74b 58 SWAP(old_path, new_path);
65056021 59 }
cd676a51
JH
60
61 if (opt->prefix &&
d04ec74b
JK
62 (strncmp(old_path, opt->prefix, opt->prefix_length) ||
63 strncmp(new_path, opt->prefix, opt->prefix_length)))
cd676a51
JH
64 return;
65
d04ec74b
JK
66 one = alloc_filespec(old_path);
67 two = alloc_filespec(new_path);
f9704c2d
BW
68 fill_filespec(one, old_oid, old_oid_valid, old_mode);
69 fill_filespec(two, new_oid, new_oid_valid, new_mode);
65056021 70
65056021
JH
71 diff_queue(&diff_queued_diff, one, two);
72}
73
74static int builtin_diff_b_f(struct rev_info *revs,
75 int argc, const char **argv,
42f5ba5b 76 struct object_array_entry **blob)
65056021
JH
77{
78 /* Blob vs file in the working tree*/
79 struct stat st;
887c6c18 80 const char *path;
65056021 81
a610786f
TH
82 if (argc > 1)
83 usage(builtin_diff_usage);
84
887c6c18
NTND
85 GUARD_PATHSPEC(&revs->prune_data, PATHSPEC_FROMTOP | PATHSPEC_LITERAL);
86 path = revs->prune_data.items[0].match;
87
65056021 88 if (lstat(path, &st))
54214529 89 die_errno(_("failed to stat '%s'"), path);
65056021 90 if (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)))
54214529 91 die(_("'%s': not a regular file or symlink"), path);
01618a3a 92
a5a818ee
JH
93 diff_set_mnemonic_prefix(&revs->diffopt, "o/", "w/");
94
42f5ba5b
JK
95 if (blob[0]->mode == S_IFINVALID)
96 blob[0]->mode = canon_mode(st.st_mode);
01618a3a 97
65056021 98 stuff_change(&revs->diffopt,
42f5ba5b
JK
99 blob[0]->mode, canon_mode(st.st_mode),
100 &blob[0]->item->oid, &null_oid,
e5450100 101 1, 0,
30d005c0
JK
102 blob[0]->path ? blob[0]->path : path,
103 path);
65056021
JH
104 diffcore_std(&revs->diffopt);
105 diff_flush(&revs->diffopt);
106 return 0;
107}
108
109static int builtin_diff_blobs(struct rev_info *revs,
110 int argc, const char **argv,
42f5ba5b 111 struct object_array_entry **blob)
65056021 112{
33de80b1 113 const unsigned mode = canon_mode(S_IFREG | 0644);
65056021 114
a610786f
TH
115 if (argc > 1)
116 usage(builtin_diff_usage);
117
42f5ba5b
JK
118 if (blob[0]->mode == S_IFINVALID)
119 blob[0]->mode = mode;
01618a3a 120
42f5ba5b
JK
121 if (blob[1]->mode == S_IFINVALID)
122 blob[1]->mode = mode;
01618a3a 123
65056021 124 stuff_change(&revs->diffopt,
42f5ba5b
JK
125 blob[0]->mode, blob[1]->mode,
126 &blob[0]->item->oid, &blob[1]->item->oid,
e5450100 127 1, 1,
158b06ca 128 blob_path(blob[0]), blob_path(blob[1]));
65056021
JH
129 diffcore_std(&revs->diffopt);
130 diff_flush(&revs->diffopt);
131 return 0;
132}
133
134static int builtin_diff_index(struct rev_info *revs,
135 int argc, const char **argv)
136{
4c3fe82e 137 unsigned int option = 0;
65056021
JH
138 while (1 < argc) {
139 const char *arg = argv[1];
2baf1850 140 if (!strcmp(arg, "--cached") || !strcmp(arg, "--staged"))
4c3fe82e 141 option |= DIFF_INDEX_CACHED;
0f5a1d44
DL
142 else if (!strcmp(arg, "--merge-base"))
143 option |= DIFF_INDEX_MERGE_BASE;
65056021
JH
144 else
145 usage(builtin_diff_usage);
146 argv++; argc--;
147 }
148 /*
149 * Make sure there is one revision (i.e. pending object),
150 * and there is no revision filtering parameters.
151 */
1f1e895f 152 if (revs->pending.nr != 1 ||
65056021
JH
153 revs->max_count != -1 || revs->min_age != -1 ||
154 revs->max_age != -1)
155 usage(builtin_diff_usage);
4c3fe82e 156 if (!(option & DIFF_INDEX_CACHED)) {
7349afd2 157 setup_work_tree();
5ab2a2da 158 if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
7349afd2
KB
159 perror("read_cache_preload");
160 return -1;
161 }
162 } else if (read_cache() < 0) {
163 perror("read_cache");
b4e1e4a7
JH
164 return -1;
165 }
4c3fe82e 166 return run_diff_index(revs, option);
65056021
JH
167}
168
169static int builtin_diff_tree(struct rev_info *revs,
170 int argc, const char **argv,
91de344d
MH
171 struct object_array_entry *ent0,
172 struct object_array_entry *ent1)
65056021 173{
9c4b0f66 174 const struct object_id *(oid[2]);
3d09c228
DL
175 struct object_id mb_oid;
176 int merge_base = 0;
a610786f 177
3d09c228
DL
178 while (1 < argc) {
179 const char *arg = argv[1];
180 if (!strcmp(arg, "--merge-base"))
181 merge_base = 1;
182 else
183 usage(builtin_diff_usage);
184 argv++; argc--;
185 }
0fe7c1de 186
3d09c228
DL
187 if (merge_base) {
188 diff_get_merge_base(revs, &mb_oid);
189 oid[0] = &mb_oid;
190 oid[1] = &revs->pending.objects[1].item->oid;
191 } else {
192 int swap = 0;
193
194 /*
195 * We saw two trees, ent0 and ent1. If ent1 is uninteresting,
196 * swap them.
197 */
198 if (ent1->item->flags & UNINTERESTING)
199 swap = 1;
200 oid[swap] = &ent0->item->oid;
201 oid[1 - swap] = &ent1->item->oid;
202 }
66f414f8 203 diff_tree_oid(oid[0], oid[1], "", &revs->diffopt);
65056021
JH
204 log_tree_diff_flush(revs);
205 return 0;
206}
207
0fe7c1de
JH
208static int builtin_diff_combined(struct rev_info *revs,
209 int argc, const char **argv,
1f1e895f 210 struct object_array_entry *ent,
0fe7c1de
JH
211 int ents)
212{
910650d2 213 struct oid_array parents = OID_ARRAY_INIT;
0fe7c1de
JH
214 int i;
215
a610786f
TH
216 if (argc > 1)
217 usage(builtin_diff_usage);
218
0fe7c1de
JH
219 if (!revs->dense_combined_merges && !revs->combine_merges)
220 revs->dense_combined_merges = revs->combine_merges = 1;
0041f09d 221 for (i = 1; i < ents; i++)
910650d2 222 oid_array_append(&parents, &ent[i].item->oid);
d01141de 223 diff_tree_combined(&ent[0].item->oid, &parents, revs);
910650d2 224 oid_array_clear(&parents);
0fe7c1de
JH
225 return 0;
226}
227
aecbf914
JH
228static void refresh_index_quietly(void)
229{
837e34eb 230 struct lock_file lock_file = LOCK_INIT;
aecbf914
JH
231 int fd;
232
837e34eb 233 fd = hold_locked_index(&lock_file, 0);
aecbf914
JH
234 if (fd < 0)
235 return;
236 discard_cache();
237 read_cache();
238 refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED);
1b0d968b 239 repo_update_index_if_able(the_repository, &lock_file);
aecbf914
JH
240}
241
0569e9b8
JH
242static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv)
243{
0569e9b8
JH
244 unsigned int options = 0;
245
246 while (1 < argc && argv[1][0] == '-') {
247 if (!strcmp(argv[1], "--base"))
248 revs->max_count = 1;
249 else if (!strcmp(argv[1], "--ours"))
250 revs->max_count = 2;
251 else if (!strcmp(argv[1], "--theirs"))
252 revs->max_count = 3;
253 else if (!strcmp(argv[1], "-q"))
254 options |= DIFF_SILENT_ON_REMOVED;
1c370ea4
MM
255 else if (!strcmp(argv[1], "-h"))
256 usage(builtin_diff_usage);
0569e9b8 257 else
54214529 258 return error(_("invalid option: %s"), argv[1]);
0569e9b8
JH
259 argv++; argc--;
260 }
261
903e09a3
JH
262 /*
263 * "diff --base" should not combine merges because it was not
264 * asked to. "diff -c" should not densify (if the user wants
265 * dense one, --cc can be explicitly asked for, or just rely
266 * on the default).
267 */
268 if (revs->max_count == -1 && !revs->combine_merges &&
0569e9b8
JH
269 (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
270 revs->combine_merges = revs->dense_combined_merges = 1;
271
4f38f6b5 272 setup_work_tree();
5ab2a2da 273 if (read_cache_preload(&revs->diffopt.pathspec) < 0) {
671c9b7e 274 perror("read_cache_preload");
0569e9b8
JH
275 return -1;
276 }
e7c3a59c 277 return run_diff_files(revs, options);
0569e9b8
JH
278}
279
8bfcb3a6
CT
280struct symdiff {
281 struct bitmap *skip;
282 int warn;
283 const char *base, *left, *right;
284};
285
286/*
287 * Check for symmetric-difference arguments, and if present, arrange
288 * everything we need to know to handle them correctly. As a bonus,
289 * weed out all bogus range-based revision specifications, e.g.,
290 * "git diff A..B C..D" or "git diff A..B C" get rejected.
291 *
292 * For an actual symmetric diff, *symdiff is set this way:
293 *
294 * - its skip is non-NULL and marks *all* rev->pending.objects[i]
295 * indices that the caller should ignore (extra merge bases, of
296 * which there might be many, and A in A...B). Note that the
297 * chosen merge base and right side are NOT marked.
298 * - warn is set if there are multiple merge bases.
299 * - base, left, and right point to the names to use in a
300 * warning about multiple merge bases.
301 *
302 * If there is no symmetric diff argument, sym->skip is NULL and
303 * sym->warn is cleared. The remaining fields are not set.
304 */
305static void symdiff_prepare(struct rev_info *rev, struct symdiff *sym)
306{
307 int i, is_symdiff = 0, basecount = 0, othercount = 0;
308 int lpos = -1, rpos = -1, basepos = -1;
309 struct bitmap *map = NULL;
310
311 /*
312 * Use the whence fields to find merge bases and left and
313 * right parts of symmetric difference, so that we do not
314 * depend on the order that revisions are parsed. If there
315 * are any revs that aren't from these sources, we have a
316 * "git diff C A...B" or "git diff A...B C" case. Or we
317 * could even get "git diff A...B C...E", for instance.
318 *
319 * If we don't have just one merge base, we pick one
320 * at random.
321 *
322 * NB: REV_CMD_LEFT, REV_CMD_RIGHT are also used for A..B,
323 * so we must check for SYMMETRIC_LEFT too. The two arrays
324 * rev->pending.objects and rev->cmdline.rev are parallel.
325 */
326 for (i = 0; i < rev->cmdline.nr; i++) {
327 struct object *obj = rev->pending.objects[i].item;
328 switch (rev->cmdline.rev[i].whence) {
329 case REV_CMD_MERGE_BASE:
330 if (basepos < 0)
331 basepos = i;
332 basecount++;
333 break; /* do mark all bases */
334 case REV_CMD_LEFT:
335 if (lpos >= 0)
336 usage(builtin_diff_usage);
337 lpos = i;
338 if (obj->flags & SYMMETRIC_LEFT) {
339 is_symdiff = 1;
340 break; /* do mark A */
341 }
342 continue;
343 case REV_CMD_RIGHT:
344 if (rpos >= 0)
345 usage(builtin_diff_usage);
346 rpos = i;
347 continue; /* don't mark B */
348 case REV_CMD_PARENTS_ONLY:
349 case REV_CMD_REF:
350 case REV_CMD_REV:
351 othercount++;
352 continue;
353 }
354 if (map == NULL)
355 map = bitmap_new();
356 bitmap_set(map, i);
357 }
358
359 /*
360 * Forbid any additional revs for both A...B and A..B.
361 */
362 if (lpos >= 0 && othercount > 0)
363 usage(builtin_diff_usage);
364
365 if (!is_symdiff) {
366 bitmap_free(map);
367 sym->warn = 0;
368 sym->skip = NULL;
369 return;
370 }
371
372 sym->left = rev->pending.objects[lpos].name;
373 sym->right = rev->pending.objects[rpos].name;
8bfcb3a6
CT
374 if (basecount == 0)
375 die(_("%s...%s: no merge base"), sym->left, sym->right);
5f46e610 376 sym->base = rev->pending.objects[basepos].name;
8bfcb3a6
CT
377 bitmap_unset(map, basepos); /* unmark the base we want */
378 sym->warn = basecount > 1;
379 sym->skip = map;
380}
381
a633fca0 382int cmd_diff(int argc, const char **argv, const char *prefix)
65056021 383{
1f1e895f 384 int i;
65056021 385 struct rev_info rev;
33055fa8
MH
386 struct object_array ent = OBJECT_ARRAY_INIT;
387 int blobs = 0, paths = 0;
42f5ba5b 388 struct object_array_entry *blob[2];
470faf96 389 int nongit = 0, no_index = 0;
41bbf9d5 390 int result = 0;
8bfcb3a6 391 struct symdiff sdiff;
65056021
JH
392
393 /*
394 * We could get N tree-ish in the rev.pending_objects list.
a9d7689c
DL
395 * Also there could be M blobs there, and P pathspecs. --cached may
396 * also be present.
65056021
JH
397 *
398 * N=0, M=0:
a9d7689c
DL
399 * cache vs files (diff-files)
400 *
401 * N=0, M=0, --cached:
402 * HEAD vs cache (diff-index --cached)
403 *
65056021
JH
404 * N=0, M=2:
405 * compare two random blobs. P must be zero.
a9d7689c 406 *
65056021 407 * N=0, M=1, P=1:
a9d7689c 408 * compare a blob with a working tree file.
65056021
JH
409 *
410 * N=1, M=0:
a9d7689c 411 * tree vs files (diff-index)
65056021 412 *
a9d7689c 413 * N=1, M=0, --cached:
65056021
JH
414 * tree vs cache (diff-index --cached)
415 *
416 * N=2, M=0:
417 * tree vs tree (diff-tree)
418 *
0569e9b8
JH
419 * N=0, M=0, P=2:
420 * compare two filesystem entities (aka --no-index).
421 *
65056021
JH
422 * Other cases are errors.
423 */
230f544e 424
470faf96
TG
425 /* Were we asked to do --no-index explicitly? */
426 for (i = 1; i < argc; i++) {
427 if (!strcmp(argv[i], "--")) {
428 i++;
429 break;
430 }
431 if (!strcmp(argv[i], "--no-index"))
432 no_index = DIFF_NO_INDEX_EXPLICIT;
433 if (argv[i][0] != '-')
434 break;
435 }
436
28a4e580 437 prefix = setup_git_directory_gently(&nongit);
6df5762d 438
28a4e580 439 if (!no_index) {
475b362c
JK
440 /*
441 * Treat git diff with at least one path outside of the
442 * repo the same as if the command would have been executed
443 * outside of a git repository. In this case it behaves
444 * the same way as "git diff --no-index <a> <b>", which acts
445 * as a colourful "diff" replacement.
446 */
447 if (nongit || ((argc == i + 2) &&
448 (!path_inside_repo(prefix, argv[i]) ||
449 !path_inside_repo(prefix, argv[i + 1]))))
450 no_index = DIFF_NO_INDEX_IMPLICIT;
451 }
470faf96 452
5404c116 453 init_diff_ui_defaults();
ef90d6d4 454 git_config(git_diff_ui_config, NULL);
90a78b83 455 precompose_argv(argc, argv);
6b2f2d98 456
2abf3503 457 repo_init_revisions(the_repository, &rev, prefix);
0569e9b8 458
287ab28b 459 /* Set up defaults that will apply to both no-index and regular diffs. */
af9fedc1 460 rev.diffopt.stat_width = -1;
df44483a 461 rev.diffopt.stat_graph_width = -1;
0d1e0e78
BW
462 rev.diffopt.flags.allow_external = 1;
463 rev.diffopt.flags.allow_textconv = 1;
61af494c 464
287ab28b
JK
465 /* If this is a no-index diff, just run it and exit there. */
466 if (no_index)
dcd6a8c0
JH
467 exit(diff_no_index(&rev, no_index == DIFF_NO_INDEX_IMPLICIT,
468 argc, argv));
469
287ab28b
JK
470
471 /*
472 * Otherwise, we are doing the usual "git" diff; set up any
473 * further defaults that apply to regular diffs.
474 */
475 rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
476
0231ae71
NTND
477 /*
478 * Default to intent-to-add entries invisible in the
479 * index. This makes them show up as new files in diff-files
480 * and not at all in diff-cached.
481 */
482 rev.diffopt.ita_invisible_in_index = 1;
483
0569e9b8 484 if (nongit)
54214529 485 die(_("Not a git repository"));
0569e9b8 486 argc = setup_revisions(argc, argv, &rev, NULL);
047fbe90 487 if (!rev.diffopt.output_format) {
c9b5ef99 488 rev.diffopt.output_format = DIFF_FORMAT_PATCH;
28452655 489 diff_setup_done(&rev.diffopt);
047fbe90 490 }
61af494c 491
0d1e0e78 492 rev.diffopt.flags.recursive = 1;
c9b5ef99 493
1af3d977 494 setup_diff_pager(&rev.diffopt);
89d07f75 495
0569e9b8
JH
496 /*
497 * Do we have --cached and not have a pending object, then
65056021
JH
498 * default to HEAD by hand. Eek.
499 */
1f1e895f 500 if (!rev.pending.nr) {
65056021
JH
501 int i;
502 for (i = 1; i < argc; i++) {
503 const char *arg = argv[i];
504 if (!strcmp(arg, "--"))
505 break;
2baf1850
DS
506 else if (!strcmp(arg, "--cached") ||
507 !strcmp(arg, "--staged")) {
3384a2df 508 add_head_to_pending(&rev);
a2b7a3b3
NTND
509 if (!rev.pending.nr) {
510 struct tree *tree;
f86bcc7b
SB
511 tree = lookup_tree(the_repository,
512 the_repository->hash_algo->empty_tree);
a2b7a3b3
NTND
513 add_pending_object(&rev, &tree->object, "HEAD");
514 }
65056021
JH
515 break;
516 }
517 }
518 }
519
8bfcb3a6 520 symdiff_prepare(&rev, &sdiff);
1f1e895f 521 for (i = 0; i < rev.pending.nr; i++) {
026f09e7
MH
522 struct object_array_entry *entry = &rev.pending.objects[i];
523 struct object *obj = entry->item;
524 const char *name = entry->name;
65056021
JH
525 int flags = (obj->flags & UNINTERESTING);
526 if (!obj->parsed)
109cd76d 527 obj = parse_object(the_repository, &obj->oid);
a74093da 528 obj = deref_tag(the_repository, obj, NULL, 0);
65056021 529 if (!obj)
54214529 530 die(_("invalid object '%s' given."), name);
1974632c 531 if (obj->type == OBJ_COMMIT)
2e27bd77 532 obj = &get_commit_tree(((struct commit *)obj))->object;
5b1e14ea 533
1974632c 534 if (obj->type == OBJ_TREE) {
8bfcb3a6
CT
535 if (sdiff.skip && bitmap_get(sdiff.skip, i))
536 continue;
65056021 537 obj->flags |= flags;
33055fa8 538 add_object_array(obj, name, &ent);
5b1e14ea 539 } else if (obj->type == OBJ_BLOB) {
65056021 540 if (2 <= blobs)
54214529 541 die(_("more than two blobs given: '%s'"), name);
42f5ba5b 542 blob[blobs] = entry;
65056021 543 blobs++;
230f544e 544
5b1e14ea
MH
545 } else {
546 die(_("unhandled object '%s' given."), name);
65056021 547 }
65056021 548 }
887c6c18 549 if (rev.prune_data.nr)
afe069d1 550 paths += rev.prune_data.nr;
65056021
JH
551
552 /*
553 * Now, do the arguments look reasonable?
554 */
33055fa8 555 if (!ent.nr) {
65056021
JH
556 switch (blobs) {
557 case 0:
0569e9b8 558 result = builtin_diff_files(&rev, argc, argv);
65056021
JH
559 break;
560 case 1:
561 if (paths != 1)
562 usage(builtin_diff_usage);
887c6c18 563 result = builtin_diff_b_f(&rev, argc, argv, blob);
65056021
JH
564 break;
565 case 2:
0fe7c1de
JH
566 if (paths)
567 usage(builtin_diff_usage);
41bbf9d5 568 result = builtin_diff_blobs(&rev, argc, argv, blob);
65056021
JH
569 break;
570 default:
571 usage(builtin_diff_usage);
572 }
573 }
574 else if (blobs)
575 usage(builtin_diff_usage);
33055fa8 576 else if (ent.nr == 1)
41bbf9d5 577 result = builtin_diff_index(&rev, argc, argv);
8bfcb3a6
CT
578 else if (ent.nr == 2) {
579 if (sdiff.warn)
580 warning(_("%s...%s: multiple merge bases, using %s"),
581 sdiff.left, sdiff.right, sdiff.base);
33055fa8
MH
582 result = builtin_diff_tree(&rev, argc, argv,
583 &ent.objects[0], &ent.objects[1]);
c008c0ff 584 } else
41bbf9d5 585 result = builtin_diff_combined(&rev, argc, argv,
33055fa8 586 ent.objects, ent.nr);
da31b358 587 result = diff_result_code(&rev.diffopt, result);
aecbf914
JH
588 if (1 < rev.diffopt.skip_stat_unmatch)
589 refresh_index_quietly();
886e1084
590 UNLEAK(rev);
591 UNLEAK(ent);
592 UNLEAK(blob);
41bbf9d5 593 return result;
65056021 594}