diff mbox series

[v4,1/2] receive-pack: fix funny ref error messsage

Message ID eef7bca63c616d745bc748fd53bdcbaf6551160b.1677666029.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit d81ba50a9b044d51039fc1a45fb6685d631d1dfe
Headers show
Series push: allow delete one level ref | expand

Commit Message

ZheNing Hu March 1, 2023, 10:20 a.m. UTC
From: ZheNing Hu <adlternative@gmail.com>

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>
---
 builtin/receive-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index cd5c7a28eff..c24616a3ac6 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -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;
 	}