Skip to content

Commit

Permalink
fast-import: test the new option command
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sverre Rabbelier authored and Junio C Hamano committed Dec 5, 2009
1 parent 9c8398f commit 2792f26
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion t/t9300-fast-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ test_expect_success \
'git cat-file blob refs/notes/foobar:$commit3 >actual && test_cmp expect actual'

###
### series R (feature)
### series R (feature and option)
###

cat >input <<EOF
Expand Down Expand Up @@ -1324,4 +1324,39 @@ test_expect_success \
'cat input | git fast-import --import-marks=marks.out &&
test_cmp marks.out marks.new'

cat >input << EOF
option git quiet
blob
data 3
hi
EOF

touch empty

test_expect_success 'R: quiet option results in no stats being output' '
cat input | git fast-import 2> output &&
test_cmp empty output
'

cat >input <<EOF
option git non-existing-option
EOF

test_expect_success 'R: die on unknown option' '
test_must_fail git fast-import <input
'

test_expect_success 'R: unknown commandline options are rejected' '\
test_must_fail git fast-import --non-existing-option < /dev/null
'

cat >input <<EOF
option non-existing-vcs non-existing-option
EOF

test_expect_success 'R: ignore non-git options' '
git fast-import <input
'

test_done

0 comments on commit 2792f26

Please sign in to comment.