Skip to content

Commit 46be023

Browse files
committed
Merge branch 'ct/diff-with-merge-base-clarification' into master
Recent update to "git diff" meant as a code clean-up introduced a bug in its error handling code, which has been corrected. * ct/diff-with-merge-base-clarification: diff: check for merge bases before assigning sym->base
2 parents 20d451c + 5f46e61 commit 46be023

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ static void symdiff_prepare(struct rev_info *rev, struct symdiff *sym)
355355

356356
sym->left = rev->pending.objects[lpos].name;
357357
sym->right = rev->pending.objects[rpos].name;
358-
sym->base = rev->pending.objects[basepos].name;
359358
if (basecount == 0)
360359
die(_("%s...%s: no merge base"), sym->left, sym->right);
360+
sym->base = rev->pending.objects[basepos].name;
361361
bitmap_unset(map, basepos); /* unmark the base we want */
362362
sym->warn = basecount > 1;
363363
sym->skip = map;

0 commit comments

Comments
 (0)