git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v8 5/7] fast-import: test the new option command

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Dec 4, 2009, 17:06 UTC
Message-ID
<1259946420-8845-6-git-send-email-srabbelier@gmail.com>
In-Reply-To
<1259946420-8845-5-git-send-email-srabbelier@gmail.com>

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>
---
	Tests updated to match the new behavior.
 t/t9300-fast-import.sh |   37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index b2c521f..74dff11 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -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
@@ -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
-- 
1.6.5.3.164.g07b0c
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 6 of 9 in “fast-import: add new feature and option command”
  1. 0/7 fast-import: add new feature and option commandSverre Rabbelier, Dec 4, 2009
  2. 1/7 fast-import: put option parsing code in separate functionsSverre Rabbelier, Dec 4, 2009
  3. 2/7 fast-import: put marks reading in it's own functionSverre Rabbelier, Dec 4, 2009
  4. 3/7 fast-import: add feature commandSverre Rabbelier, Dec 4, 2009
  5. 4/7 fast-import: add option commandSverre Rabbelier, Dec 4, 2009
  6. 5/7 fast-import: test the new option commandSverre Rabbelier, Dec 4, 2009
  7. 6/7 fast-import: allow for multiple --import-marks= argumentsSverre Rabbelier, Dec 4, 2009
  8. 7/7 fast-import: add (non-)relative-marks featureSverre Rabbelier, Dec 4, 2009
  9. Daniel BarkalowDec 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.