]> git.ipfire.org Git - thirdparty/git.git/commitdiff
receive-pack: fix funny ref error messsage
authorZheNing Hu <adlternative@gmail.com>
Wed, 1 Mar 2023 10:20:28 +0000 (10:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Mar 2023 16:08:09 +0000 (08:08 -0800)
When the user deletes the remote one level branch through
"git push origin -d refs/foo", remote will return an error:
"refusing to create funny ref 'refs/foo' remotely", here we
are not creating "refs/foo" instead wants to delete it, so a
better error description here would be: "refusing to update
funny ref 'refs/foo' remotely".

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c

index cd5c7a28eff08f048b79a9d739800709c443c160..c24616a3ac6b1c7ddeaae5602f32fd4c0824fa48 100644 (file)
@@ -1464,7 +1464,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
 
        /* only refs/... are allowed */
        if (!starts_with(name, "refs/") || check_refname_format(name + 5, 0)) {
-               rp_error("refusing to create funny ref '%s' remotely", name);
+               rp_error("refusing to update funny ref '%s' remotely", name);
                ret = "funny refname";
                goto out;
        }