Skip to content

Commit 2792f26

Browse files
SRabbeliergitster
authored andcommitted
fast-import: test the new option command
Test the quiet option and verify that the commandline options override it. Also make sure that an unknown option command is rejected and that non-git options are ignored. Lastly, show that unknown options are rejected when parsed on the commandline. Signed-off-by: Sverre Rabbelier <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9c8398f commit 2792f26

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

t/t9300-fast-import.sh

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ test_expect_success \
12551255
'git cat-file blob refs/notes/foobar:$commit3 >actual && test_cmp expect actual'
12561256

12571257
###
1258-
### series R (feature)
1258+
### series R (feature and option)
12591259
###
12601260

12611261
cat >input <<EOF
@@ -1324,4 +1324,39 @@ test_expect_success \
13241324
'cat input | git fast-import --import-marks=marks.out &&
13251325
test_cmp marks.out marks.new'
13261326

1327+
cat >input << EOF
1328+
option git quiet
1329+
blob
1330+
data 3
1331+
hi
1332+
1333+
EOF
1334+
1335+
touch empty
1336+
1337+
test_expect_success 'R: quiet option results in no stats being output' '
1338+
cat input | git fast-import 2> output &&
1339+
test_cmp empty output
1340+
'
1341+
1342+
cat >input <<EOF
1343+
option git non-existing-option
1344+
EOF
1345+
1346+
test_expect_success 'R: die on unknown option' '
1347+
test_must_fail git fast-import <input
1348+
'
1349+
1350+
test_expect_success 'R: unknown commandline options are rejected' '\
1351+
test_must_fail git fast-import --non-existing-option < /dev/null
1352+
'
1353+
1354+
cat >input <<EOF
1355+
option non-existing-vcs non-existing-option
1356+
EOF
1357+
1358+
test_expect_success 'R: ignore non-git options' '
1359+
git fast-import <input
1360+
'
1361+
13271362
test_done

0 commit comments

Comments
 (0)