Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Apr 2008 04:47:51 +0000 (21:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Apr 2008 04:47:51 +0000 (21:47 -0700)
* maint:
clone: detect and fail on excess parameters
Remove 'header' from --signoff option description

builtin-commit.c
git-clone.sh
t/t5601-clone.sh [new file with mode: 0755]
index b41d4a3561d6fd4376c1520c3b7dd436674e8325..256181a68bd991278fda4ecb48911d03b5f23141 100644 (file)
@@ -90,7 +90,7 @@ static struct option builtin_commit_options[] = {
        OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m),
        OPT_STRING('c', "reedit-message", &edit_message, "COMMIT", "reuse and edit message from specified commit "),
        OPT_STRING('C', "reuse-message", &use_message, "COMMIT", "reuse message from specified commit"),
-       OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by: header"),
+       OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
        OPT_STRING('t', "template", &template_file, "FILE", "use specified template file"),
        OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
 
index 2636159aaa7a6278d9b8fc64b853b319ac8da123..9e433c08086f3a80c91cc9dae1e48c88723b82f8 100755 (executable)
@@ -219,6 +219,7 @@ fi
 if test -n "$2"
 then
        dir="$2"
+       test $# == 2 || die "excess parameter to git-clone"
 else
        # Derive one from the repository name
        # Try using "humanish" part of source repo if user didn't specify one
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
new file mode 100755 (executable)
index 0000000..dc9d63d
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description=clone
+
+. ./test-lib.sh
+
+test_expect_success setup '
+
+       rm -fr .git &&
+       test_create_repo src &&
+       (
+               cd src
+               >file
+               git add file
+               git commit -m initial
+       )
+
+'
+
+test_expect_success 'clone with excess parameters' '
+
+       test_must_fail git clone -n "file://$(pwd)/src" dst junk
+
+'
+
+test_done