diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-12-20 01:45:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-20 01:45:34 +0300 |
commit | 3aead1cad7a9a35534b86763bbe8c97dfd3f1a03 (patch) | |
tree | dbfbcae1d285ce8e6e7d51b45285f712191e0662 /t/t7501-commit.sh | |
parent | afe0e2a391665c01daae78d8f8a9a105420b0218 (diff) | |
parent | beb635ca9ced5cd8f0eb5d2def9468f14bd243bc (diff) |
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/t7501-commit.sh')
-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 4003a27e6a..0b6da7ae1f 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 |