@matheusbsbs / matheus-bagliano / commits / 972a915583
Fork 0

Make write_sha1_file_prepare() void

Move file name generation from write_sha1_file_prepare() to the one caller that cares and make it a void function. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>

Rene Scharfe committed Oct 15, 2006 at 14:02 UTC 972a9155832165ea38febba2303e7c760050b5d8
1 file changed +5 -6
sha1_file.c
+5 -6
@@ -1347,9 +1347,9 @@ void *read_object_with_reference(const unsigned char *sha1,
1347 }
1348 }
1349
1350 -static char *write_sha1_file_prepare(void *buf, unsigned long len,
1351 - const char *type, unsigned char *sha1,
1352 - unsigned char *hdr, int *hdrlen)
1350 +static void write_sha1_file_prepare(void *buf, unsigned long len,
1351 + const char *type, unsigned char *sha1,
1352 + unsigned char *hdr, int *hdrlen)
1353 {
1354 SHA_CTX c;
1355
@@ -1361,8 +1361,6 @@ static char *write_sha1_file_prepare(void *buf, unsigned long len,
1361 SHA1_Update(&c, hdr, *hdrlen);
1362 SHA1_Update(&c, buf, len);
1363 SHA1_Final(sha1, &c);
1364 -
1365 - return sha1_file_name(sha1);
1364 }
1365
1366 /*
@@ -1521,7 +1519,8 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
1519 /* Normally if we have it in the pack then we do not bother writing
1520 * it out into .git/objects/??/?{38} file.
1521 */
1524 - filename = write_sha1_file_prepare(buf, len, type, sha1, hdr, &hdrlen);
1522 + write_sha1_file_prepare(buf, len, type, sha1, hdr, &hdrlen);
1523 + filename = sha1_file_name(sha1);
1524 if (returnsha1)
1525 hashcpy(returnsha1, sha1);
1526 if (has_sha1_file(sha1))