@matheusbsbs / matheus-bagliano / commits / 2792f26c3e
Fork 0

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 <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sverre Rabbelier committed Dec 4, 2009 at 18:06 UTC 2792f26c3e93c268732957b71c0390a1efe14d7e
1 file changed +36 -1
t/t9300-fast-import.sh
+36 -1
@@ -1255,7 +1255,7 @@ test_expect_success \
1255 'git cat-file blob refs/notes/foobar:$commit3 >actual && test_cmp expect actual'
1256
1257 ###
1258 -### series R (feature)
1258 +### series R (feature and option)
1259 ###
1260
1261 cat >input <<EOF
@@ -1324,4 +1324,39 @@ test_expect_success \
1324 'cat input | git fast-import --import-marks=marks.out &&
1325 test_cmp marks.out marks.new'
1326
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 +
1362 test_done