From 311fc74826ac91cd6f6ea932460f88c475bbb310 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 2 Mar 2017 03:21:27 -0500 Subject: strbuf_branchname: drop return value The return value from strbuf_branchname() is confusing and useless: it's 0 if the whole name was consumed by an @-mark, but otherwise is the length of the original name we fed. No callers actually look at the return value, so let's just get rid of it. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- sha1_name.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sha1_name.c') diff --git a/sha1_name.c b/sha1_name.c index 28865b3a1f..4c1e91184b 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -1279,17 +1279,14 @@ int interpret_branch_name(const char *name, int namelen, struct strbuf *buf) return -1; } -int strbuf_branchname(struct strbuf *sb, const char *name) +void strbuf_branchname(struct strbuf *sb, const char *name) { int len = strlen(name); int used = interpret_branch_name(name, len, sb); - if (used == len) - return 0; if (used < 0) used = 0; strbuf_add(sb, name + used, len - used); - return len; } int strbuf_check_branch_ref(struct strbuf *sb, const char *name) -- cgit v1.2.3