summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-17 23:11:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-17 23:11:03 (GMT)
commit9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94 (patch)
tree8433cce3f129be82632e1c71f4d6744d7fb61d8f /t
parent935a4783f72964e0fa72995c101542531081b094 (diff)
parentbeb635ca9ced5cd8f0eb5d2def9468f14bd243bc (diff)
downloadgit-9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94.zip
git-9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94.tar.gz
git-9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94.tar.bz2
Merge branch 'ak/commit-only-allow-empty' into maint
"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 d84897a..0d8d893 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