diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 6b1ba6c858562b7c085951fb1d69d4d2371e866c..f256475020549a157297481e21859e235a5cfcc1 100755 (executable)
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
test_cmp marks.out marks.new'
cat >input <<EOF
test_cmp marks.out marks.new'
cat >input <<EOF
-feature import-marks=nonexistant.marks
+feature import-marks=nonexistent.marks
feature export-marks=marks.new
EOF
feature export-marks=marks.new
EOF
cat >input <<EOF
cat >input <<EOF
-feature import-marks=nonexistant.marks
+feature import-marks=nonexistent.marks
feature export-marks=combined.marks
EOF
feature export-marks=combined.marks
EOF
test_cmp empty output
'
test_cmp empty output
'
+test_expect_success 'R: feature done means terminating "done" is mandatory' '
+ echo feature done | test_must_fail git fast-import &&
+ test_must_fail git fast-import --done </dev/null
+'
+
+test_expect_success 'R: terminating "done" with trailing gibberish is ok' '
+ git fast-import <<-\EOF &&
+ feature done
+ done
+ trailing gibberish
+ EOF
+ git fast-import <<-\EOF
+ done
+ more trailing gibberish
+ EOF
+'
+
+test_expect_success 'R: terminating "done" within commit' '
+ cat >expect <<-\EOF &&
+ OBJID
+ :000000 100644 OBJID OBJID A hello.c
+ :000000 100644 OBJID OBJID A hello2.c
+ EOF
+ git fast-import <<-EOF &&
+ commit refs/heads/done-ends
+ committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+ data <<EOT
+ Commit terminated by "done" command
+ EOT
+ M 100644 inline hello.c
+ data <<EOT
+ Hello, world.
+ EOT
+ C hello.c hello2.c
+ done
+ EOF
+ git rev-list done-ends |
+ git diff-tree -r --stdin --root --always |
+ sed -e "s/$_x40/OBJID/g" >actual &&
+ test_cmp expect actual
+'
+
cat >input <<EOF
option git non-existing-option
EOF
cat >input <<EOF
option git non-existing-option
EOF