Skip to content

Commit

Permalink
Merge branch 'tr/test-commit-only-on-orphan' into maint
Browse files Browse the repository at this point in the history
* tr/test-commit-only-on-orphan:
  Test 'commit --only' after 'checkout --orphan'
  • Loading branch information
Junio C Hamano committed Jul 19, 2013
2 parents 509152d + f0c7320 commit 8589a74
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t7501-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8589a74

Please sign in to comment.