aboutsummaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-23 14:54:28 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-23 14:54:28 -0700
commit9ce2824e4ba56bf0f2017a0e351fa35c22a705ac (patch)
tree799aa15994da31edcbd4dc6b79a3c4b3e6458ac9 /t/t7501-commit.sh
parent3916adf9978b020f9a9b165f4c1c109046899560 (diff)
parent8dc874b2ee61f0c457c4482ed2f202cac55b52ad (diff)
downloadgit-9ce2824e4ba56bf0f2017a0e351fa35c22a705ac.tar.gz
git-9ce2824e4ba56bf0f2017a0e351fa35c22a705ac.tar.xz
Merge branch 'ss/commit-dry-run-resolve-merge-to-no-op'
"git commit --dry-run" reported "No, no, you cannot commit." in one case where "git commit" would have allowed you to commit, and this improves it a little bit ("git commit --dry-run --short" still does not give you the correct answer, for example). This is a stop-gap measure in that "commit --short --dry-run" still gives an incorrect result. * ss/commit-dry-run-resolve-merge-to-no-op: wt-status.c: set commitable bit if there is a meaningful merge.
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 900f7de05..d84897a67 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -607,4 +607,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