]> git.ipfire.org Git - thirdparty/git.git/blobdiff - http-walker.c
Fix random sha1 in error message in http-fetch and http-push
[thirdparty/git.git] / http-walker.c
index a3fb596542eea6d85a6cb32add100e8d71e7713a..0faafbce6164b18cdd960bc8c7d254507d4a2731 100644 (file)
@@ -986,9 +986,10 @@ static int fetch_ref(struct walker *walker, char *ref, unsigned char *sha1)
                return error("Unable to start request");
        }
 
+       if (buffer.posn != 41)
+               return 1;
         hex[40] = '\0';
-        get_sha1_hex(hex, sha1);
-        return 0;
+       return get_sha1_hex(hex, sha1);
 }
 
 static void cleanup(struct walker *walker)