]> granicus.if.org Git - git/commitdiff
read_raw_ref(): clear *type at start of function
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 21 Apr 2016 23:11:17 +0000 (01:11 +0200)
committerMichael Haggerty <mhagger@alum.mit.edu>
Mon, 13 Jun 2016 09:23:49 +0000 (11:23 +0200)
This is more convenient and less error-prone for callers.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
refs/files-backend.c

index 1657ce751257751eb030f7fb608fd3c39b9f8283..3c99eef42aa4154f31f9764623656e6f5ec44186 100644 (file)
@@ -1430,6 +1430,7 @@ int read_raw_ref(const char *refname, unsigned char *sha1,
        int ret = -1;
        int save_errno;
 
+       *type = 0;
        strbuf_reset(&sb_path);
        strbuf_git_path(&sb_path, "%s", refname);
        path = sb_path.buf;