Skip to content

Commit 7a0e4d7

Browse files
committed
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.
1 parent c008c0f commit 7a0e4d7

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

builtin-diff.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
406406
else if (ents == 2)
407407
result = builtin_diff_tree(&rev, argc, argv, ent);
408408
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?");
422409
/*
423410
* diff A...B where there is at least one merge base
424411
* between A and B. We have ent[0] == merge-base,

0 commit comments

Comments
 (0)