Skip to content

Commit 633d1fe

Browse files
committed
Merge branch 'maint'
* maint: clone: detect and fail on excess parameters Remove 'header' from --signoff option description
2 parents 07ba53f + a2b26ac commit 633d1fe

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

builtin-commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static struct option builtin_commit_options[] = {
9090
OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m),
9191
OPT_STRING('c', "reedit-message", &edit_message, "COMMIT", "reuse and edit message from specified commit "),
9292
OPT_STRING('C', "reuse-message", &use_message, "COMMIT", "reuse message from specified commit"),
93-
OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by: header"),
93+
OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
9494
OPT_STRING('t', "template", &template_file, "FILE", "use specified template file"),
9595
OPT_BOOLEAN('e', "edit", &edit_flag, "force edit of commit"),
9696

git-clone.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ fi
219219
if test -n "$2"
220220
then
221221
dir="$2"
222+
test $# == 2 || die "excess parameter to git-clone"
222223
else
223224
# Derive one from the repository name
224225
# Try using "humanish" part of source repo if user didn't specify one

t/t5601-clone.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
test_description=clone
4+
5+
. ./test-lib.sh
6+
7+
test_expect_success setup '
8+
9+
rm -fr .git &&
10+
test_create_repo src &&
11+
(
12+
cd src
13+
>file
14+
git add file
15+
git commit -m initial
16+
)
17+
18+
'
19+
20+
test_expect_success 'clone with excess parameters' '
21+
22+
test_must_fail git clone -n "file://$(pwd)/src" dst junk
23+
24+
'
25+
26+
test_done

0 commit comments

Comments
 (0)