mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
fetch-pack: use skip_prefix() instead of starts_with()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3f0f6624f5
commit
45a3e52641
|
@ -59,12 +59,12 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
|
|||
for (i = 1; i < argc && *argv[i] == '-'; i++) {
|
||||
const char *arg = argv[i];
|
||||
|
||||
if (starts_with(arg, "--upload-pack=")) {
|
||||
args.uploadpack = arg + 14;
|
||||
if (skip_prefix(arg, "--upload-pack=", &arg)) {
|
||||
args.uploadpack = arg;
|
||||
continue;
|
||||
}
|
||||
if (starts_with(arg, "--exec=")) {
|
||||
args.uploadpack = arg + 7;
|
||||
if (skip_prefix(arg, "--exec=", &arg)) {
|
||||
args.uploadpack = arg;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp("--quiet", arg) || !strcmp("-q", arg)) {
|
||||
|
@ -100,8 +100,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
|
|||
args.verbose = 1;
|
||||
continue;
|
||||
}
|
||||
if (starts_with(arg, "--depth=")) {
|
||||
args.depth = strtol(arg + 8, NULL, 0);
|
||||
if (skip_prefix(arg, "--depth=", &arg)) {
|
||||
args.depth = strtol(arg, NULL, 0);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp("--no-progress", arg)) {
|
||||
|
|
Loading…
Reference in a new issue