diff A...B: do not limit the syntax too narrowly
Earlier we tried to make sure that the trees we get are what A...B syntax produced, by checking that earlier ones are all marked uninteresting (which has to be true as they are merge bases), there are two remaining ones that are interesting, and they are marked as non-symmetric-left and symmetric-left respectively. The "the last two must be interesting" condition is however wrong when one is an ancestor of the other between A and B (i.e. fast-forward). In such a case, one of them is marked uninteresting.
Junio C Hamano committed
Jul 16, 2010 at 12:08 UTC
7a0e4d7c39083e951625e4c3434d05abfea8f5e6
1 file changed
-13
builtin-diff.c
-13
@@ -406,19 +406,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
406
else if (ents == 2)
407
result = builtin_diff_tree(&rev, argc, argv, ent);
408
else if (ent[0].item->flags & UNINTERESTING) {
409
- /*
410
- * Perhaps the user gave us A...B, which expands
411
- * to a list of negative merge bases followed by
412
- * A (symmetric-left) and B? Let's make sure...
413
- */
414
- for (i = 1; i < ents; i++)
415
- if (!(ent[i].item->flags & UNINTERESTING))
416
- break;
417
- if (ents != i + 2 ||
418
- (ent[i+1].item->flags & UNINTERESTING) ||
419
- (!(ent[i].item->flags & SYMMETRIC_LEFT)) ||
420
- (ent[i+1].item->flags & SYMMETRIC_LEFT))
421
- die("what do you mean by that?");
409
/*
410
* diff A...B where there is at least one merge base
411
* between A and B. We have ent[0] == merge-base,