We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 509152d + f0c7320 commit 8589a74Copy full SHA for 8589a74
t/t7501-commit.sh
@@ -524,4 +524,17 @@ test_expect_success 'commit a file whose name is a dash' '
524
test_i18ngrep " changed, 5 insertions" output
525
'
526
527
+test_expect_success '--only works on to-be-born branch' '
528
+ # This test relies on having something in the index, as it
529
+ # would not otherwise actually prove much. So check this.
530
+ test -n "$(git ls-files)" &&
531
+ git checkout --orphan orphan &&
532
+ echo foo >newfile &&
533
+ git add newfile &&
534
+ git commit --only newfile -m"--only on unborn branch" &&
535
+ echo newfile >expected &&
536
+ git ls-tree -r --name-only HEAD >actual &&
537
+ test_cmp expected actual
538
+'
539
+
540
test_done
0 commit comments