]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-refs: remove unnecessary sanity check
authorJohn Keeping <john@keeping.me.uk>
Sat, 31 Mar 2018 13:57:22 +0000 (14:57 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 27 Jun 2018 16:11:19 +0000 (18:11 +0200)
There is no way for refinfo::refname to be null, and Git will prevent
zero-length refs so this check is unnecessary.

Signed-off-by: John Keeping <john@keeping.me.uk>
Reviewed-by: Christian Hesse <mail@eworm.de>
ui-refs.c

index 50d9d3002951760c4cf228d0cce6af7c016b9511..7b95e8b76324ffcf1374a392f9d71c81d29f671a 100644 (file)
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -97,9 +97,6 @@ static void print_tag_downloads(const struct cgit_repo *repo, const char *ref)
        struct strbuf filename = STRBUF_INIT;
        size_t prefixlen;
 
-       if (!ref || strlen(ref) < 1)
-               return;
-
        basename = cgit_snapshot_prefix(repo);
        if (starts_with(ref, basename))
                strbuf_addstr(&filename, ref);