diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:11:03 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:11:03 -0800 |
commit | 9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94 (patch) | |
tree | 8433cce3f129be82632e1c71f4d6744d7fb61d8f /t | |
parent | 935a4783f72964e0fa72995c101542531081b094 (diff) | |
parent | beb635ca9ced5cd8f0eb5d2def9468f14bd243bc (diff) | |
download | git-9d2a24864e8f0a1ab2fc6b72c64a4f1d4aa9fe94.tar.gz |
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-x | t/t7501-commit.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index d84897a67a..0d8d893090 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 |