diff options
Diffstat (limited to 'builtin/receive-pack.c')
| -rw-r--r-- | builtin/receive-pack.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index bc4f5dc463..85bba356fa 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -478,7 +478,7 @@ static const char *update(struct command *cmd, struct shallow_info *si) struct ref_lock *lock; /* only refs/... are allowed */ - if (prefixcmp(name, "refs/") || check_refname_format(name + 5, 0)) { + if (!starts_with(name, "refs/") || check_refname_format(name + 5, 0)) { rp_error("refusing to create funny ref '%s' remotely", name); return "funny refname"; } @@ -509,7 +509,7 @@ static const char *update(struct command *cmd, struct shallow_info *si) } if (!is_null_sha1(old_sha1) && is_null_sha1(new_sha1)) { - if (deny_deletes && !prefixcmp(name, "refs/heads/")) { + if (deny_deletes && starts_with(name, "refs/heads/")) { rp_error("denying ref deletion for %s", name); return "deletion prohibited"; } @@ -533,7 +533,7 @@ static const char *update(struct command *cmd, struct shallow_info *si) if (deny_non_fast_forwards && !is_null_sha1(new_sha1) && !is_null_sha1(old_sha1) && - !prefixcmp(name, "refs/heads/")) { + starts_with(name, "refs/heads/")) { struct object *old_object, *new_object; struct commit *old_commit, *new_commit; @@ -853,7 +853,7 @@ static struct command *read_head_info(struct sha1_array *shallow) if (!line) break; - if (len == 48 && !prefixcmp(line, "shallow ")) { + if (len == 48 && starts_with(line, "shallow ")) { if (get_sha1_hex(line + 8, old_sha1)) die("protocol error: expected shallow sha, got '%s'", line + 8); sha1_array_append(shallow, old_sha1); |
