summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-19 17:40:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-19 17:40:57 (GMT)
commit8589a74b191f1842b633020e28de1c4a1c7f607c (patch)
tree6f951d7711f1dd10a3fab80efd77635433d89497 /t
parent509152d3fa543bd3e030825ecefda298bbc4dfa7 (diff)
parentf0c73200e86b6166596f45ce32b7f04291074182 (diff)
downloadgit-8589a74b191f1842b633020e28de1c4a1c7f607c.zip
git-8589a74b191f1842b633020e28de1c4a1c7f607c.tar.gz
git-8589a74b191f1842b633020e28de1c4a1c7f607c.tar.bz2
Merge branch 'tr/test-commit-only-on-orphan' into maint
* tr/test-commit-only-on-orphan: Test 'commit --only' after 'checkout --orphan'
Diffstat (limited to 't')
-rwxr-xr-xt/t7501-commit.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 195e747..99ce36f 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