]> 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 444aebf5268c982255f73b151ff5c03bdffecdbe..0faafbce6164b18cdd960bc8c7d254507d4a2731 100644 (file)
@@ -405,7 +405,7 @@ static int fetch_index(struct walker *walker, struct alt_base *repo, unsigned ch
        indexfile = fopen(tmpfile, "a");
        if (!indexfile)
                return error("Unable to open local file %s for pack index",
-                            filename);
+                            tmpfile);
 
        slot = get_active_slot();
        slot->results = &results;
@@ -770,7 +770,7 @@ static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned cha
        packfile = fopen(tmpfile, "a");
        if (!packfile)
                return error("Unable to open local file %s for pack",
-                            filename);
+                            tmpfile);
 
        slot = get_active_slot();
        slot->results = &results;
@@ -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)