summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-19 22:45:34 (GMT)
commit3aead1cad7a9a35534b86763bbe8c97dfd3f1a03 (patch)
treedbfbcae1d285ce8e6e7d51b45285f712191e0662 /t
parentafe0e2a391665c01daae78d8f8a9a105420b0218 (diff)
parentbeb635ca9ced5cd8f0eb5d2def9468f14bd243bc (diff)
downloadgit-3aead1cad7a9a35534b86763bbe8c97dfd3f1a03.zip
git-3aead1cad7a9a35534b86763bbe8c97dfd3f1a03.tar.gz
git-3aead1cad7a9a35534b86763bbe8c97dfd3f1a03.tar.bz2
Merge branch 'ak/commit-only-allow-empty'
"git commit --allow-empty --only" (no pathspec) with dirty index ought to be an acceptable way to create a new commit that does not change any paths, but it was forbidden, perhaps because nobody needed it so far. * ak/commit-only-allow-empty: commit: remove 'Clever' message for --only --amend commit: make --only --allow-empty work without paths
Diffstat (limited to 't')
-rwxr-xr-xt/t7501-commit.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 4003a27..0b6da7a 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -155,6 +155,15 @@ test_expect_success 'amend --only ignores staged contents' '
git diff --exit-code
'
+test_expect_success 'allow-empty --only ignores staged contents' '
+ echo changed-again >file &&
+ git add file &&
+ git commit --allow-empty --only -m "empty" &&
+ git cat-file blob HEAD:file >file.actual &&
+ test_cmp file.expect file.actual &&
+ git diff --exit-code
+'
+
test_expect_success 'set up editor' '
cat >editor <<-\EOF &&
#!/bin/sh