Skip to content

Commit 7cc6ed2

Browse files
jonathantanmygitster
authored andcommitted
upload-pack: fix error message typo
Fix a typo in an error message. Also, this line was introduced in 3145ea9 ("upload-pack: introduce fetch server command", 2018-03-15), which did not contain a test for the case which causes this error to be printed, so introduce a test. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea44c0a commit 7cc6ed2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

t/t5701-git-serve.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,18 @@ test_expect_success 'symrefs parameter' '
173173
test_cmp actual expect
174174
'
175175

176+
test_expect_success 'unexpected lines are not allowed in fetch request' '
177+
git init server &&
178+
179+
test-pkt-line pack >in <<-EOF &&
180+
command=fetch
181+
0001
182+
this-is-not-a-command
183+
0000
184+
EOF
185+
186+
test_must_fail git -C server serve --stateless-rpc <in >/dev/null 2>err &&
187+
grep "unexpected line: .this-is-not-a-command." err
188+
'
189+
176190
test_done

upload-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ static void process_args(struct packet_reader *request,
12521252
}
12531253

12541254
/* ignore unknown lines maybe? */
1255-
die("unexpect line: '%s'", arg);
1255+
die("unexpected line: '%s'", arg);
12561256
}
12571257
}
12581258

0 commit comments

Comments
 (0)