wt-status.c: set commitable bit if there is a meaningful merge.
The 'commit --dry-run' and 'commit' return values differed if a conflicted merge had been resolved and the resulting commit would record the same tree as the parent. Update show_merge_in_progress to set the commitable bit if conflicts have been resolved and a merge is in progress. Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stephen P. Smith committed
Feb 15, 2016 at 19:38 UTC
8dc874b2ee61f0c457c4482ed2f202cac55b52ad
2 files changed
+21
t/t7501-commit.sh
+20
@@ -587,4 +587,24 @@ test_expect_success '--only works on to-be-born branch' '
587
test_cmp expected actual
588
'
589
590
+test_expect_success '--dry-run with conflicts fixed from a merge' '
591
+ # setup two branches with conflicting information
592
+ # in the same file, resolve the conflict,
593
+ # call commit with --dry-run
594
+ echo "Initial contents, unimportant" >test-file &&
595
+ git add test-file &&
596
+ git commit -m "Initial commit" &&
597
+ echo "commit-1-state" >test-file &&
598
+ git commit -m "commit 1" -i test-file &&
599
+ git tag commit-1 &&
600
+ git checkout -b branch-2 HEAD^1 &&
601
+ echo "commit-2-state" >test-file &&
602
+ git commit -m "commit 2" -i test-file &&
603
+ ! $(git merge --no-commit commit-1) &&
604
+ echo "commit-2-state" >test-file &&
605
+ git add test-file &&
606
+ git commit --dry-run &&
607
+ git commit -m "conflicts fixed from merge."
608
+'
609
+
610
test_done
wt-status.c
+1
@@ -949,6 +949,7 @@ static void show_merge_in_progress(struct wt_status *s,
949
status_printf_ln(s, color,
950
_(" (fix conflicts and run \"git commit\")"));
951
} else {
952
+ s-> commitable = 1;
953
status_printf_ln(s, color,
954
_("All conflicts fixed but you are still merging."));
955
if (s->hints)