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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 2, 2017 at 03:21 UTC 311fc74826ac91cd6f6ea932460f88c475bbb310
2 files changed +2 -5
sha1_name.c
+1 -4
@@ -1279,17 +1279,14 @@ int interpret_branch_name(const char *name, int namelen, struct strbuf *buf)
1279 return -1;
1280 }
1281
1282 -int strbuf_branchname(struct strbuf *sb, const char *name)
1282 +void strbuf_branchname(struct strbuf *sb, const char *name)
1283 {
1284 int len = strlen(name);
1285 int used = interpret_branch_name(name, len, sb);
1286
1287 - if (used == len)
1288 - return 0;
1287 if (used < 0)
1288 used = 0;
1289 strbuf_add(sb, name + used, len - used);
1292 - return len;
1290 }
1291
1292 int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
strbuf.h
+1 -1
@@ -562,7 +562,7 @@ static inline void strbuf_complete_line(struct strbuf *sb)
562 strbuf_complete(sb, '\n');
563 }
564
565 -extern int strbuf_branchname(struct strbuf *sb, const char *name);
565 +extern void strbuf_branchname(struct strbuf *sb, const char *name);
566 extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
567
568 extern void strbuf_addstr_urlencode(struct strbuf *, const char *,