use wildmatch() directly without fnmatch() wrapper
[gitweb.git] / builtin / receive-pack.c
index bc4f5dc4632350c39972a0c1c589f10f90b120df..85bba356fab7743506f00bb0c5ca955eb9112bd5 100644 (file)
@@ -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);