diff options
author | Stephen P. Smith <ischis2@cox.net> | 2016-02-16 05:38:25 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-17 19:53:11 +0300 |
commit | 8dc874b2ee61f0c457c4482ed2f202cac55b52ad (patch) | |
tree | 06b75f7a95b428f85baaa1848764204c67fda9c0 /t/t7501-commit.sh | |
parent | a2558fb8e1e387b630312311e1d22c95663da5d0 (diff) |
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>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-x | t/t7501-commit.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 63e04277f9..363abb187e 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -587,4 +587,24 @@ test_expect_success '--only works on to-be-born branch' ' test_cmp expected actual ' +test_expect_success '--dry-run with conflicts fixed from a merge' ' + # setup two branches with conflicting information + # in the same file, resolve the conflict, + # call commit with --dry-run + echo "Initial contents, unimportant" >test-file && + git add test-file && + git commit -m "Initial commit" && + echo "commit-1-state" >test-file && + git commit -m "commit 1" -i test-file && + git tag commit-1 && + git checkout -b branch-2 HEAD^1 && + echo "commit-2-state" >test-file && + git commit -m "commit 2" -i test-file && + ! $(git merge --no-commit commit-1) && + echo "commit-2-state" >test-file && + git add test-file && + git commit --dry-run && + git commit -m "conflicts fixed from merge." +' + test_done |