diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-11 13:30:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-11 13:30:12 -0700 |
commit | 9845bbba972c0299ae6d74c3e85dafba8372b6b4 (patch) | |
tree | 3a1de55f84d5c58c4dbf5f1cec9f1cfa66cac41d | |
parent | dd261b1727e4c251e761b45295c00d1cfcf52b8b (diff) | |
parent | f0c73200e86b6166596f45ce32b7f04291074182 (diff) | |
download | git-9845bbba972c0299ae6d74c3e85dafba8372b6b4.tar.gz git-9845bbba972c0299ae6d74c3e85dafba8372b6b4.tar.xz |
Merge branch 'tr/test-commit-only-on-orphan'
* tr/test-commit-only-on-orphan:
Test 'commit --only' after 'checkout --orphan'
-rwxr-xr-x | t/t7501-commit.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 195e7477d..99ce36f5e 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -524,4 +524,17 @@ test_expect_success 'commit a file whose name is a dash' ' test_i18ngrep " changed, 5 insertions" output ' +test_expect_success '--only works on to-be-born branch' ' + # This test relies on having something in the index, as it + # would not otherwise actually prove much. So check this. + test -n "$(git ls-files)" && + git checkout --orphan orphan && + echo foo >newfile && + git add newfile && + git commit --only newfile -m"--only on unborn branch" && + echo newfile >expected && + git ls-tree -r --name-only HEAD >actual && + test_cmp expected actual +' + test_done |