resolve_gitlink_ref(): eliminate temporary variable
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 4 Sep 2016 16:08:07 +0000 (18:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Sep 2016 22:28:12 +0000 (15:28 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c

index a9ca003..d56fc15 100644 (file)
@@ -1387,7 +1387,7 @@ static int resolve_gitlink_ref_recursive(struct ref_cache *refs,
 
 int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *sha1)
 {
-       int len = strlen(path), retval;
+       int len = strlen(path);
        struct strbuf submodule = STRBUF_INIT;
        struct ref_cache *refs;
 
@@ -1404,8 +1404,7 @@ int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *sh
        }
        strbuf_release(&submodule);
 
-       retval = resolve_gitlink_ref_recursive(refs, refname, sha1, 0);
-       return retval;
+       return resolve_gitlink_ref_recursive(refs, refname, sha1, 0);
 }
 
 /*