mirror of
https://github.com/git/git.git
synced 2024-12-11 19:03:50 +08:00
Merge branch 'tr/test-commit-only-on-orphan' into maint
* tr/test-commit-only-on-orphan: Test 'commit --only' after 'checkout --orphan'
This commit is contained in:
commit
8589a74b19
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user