{"thread":{"id":"5929","subject":"[PATCH 1/2] Make write_sha1_file_prepare() void","startedAt":"2006-10-15T12:02:03Z","lastAt":"2006-10-15T12:02:03Z","messageCount":1,"participants":["Rene Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28796","messageId":"4532233B.5070408@lsrfire.ath.cx","threadId":"5929","inReplyTo":null,"subject":"[PATCH 1/2] Make write_sha1_file_prepare() void","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2006-10-15T12:02:03Z","receivedAt":"2006-10-15T12:02:03Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Move file name generation from write_sha1_file_prepare() to the one\ncaller that cares and make it a void function.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n sha1_file.c |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex d111be7..66cc767 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -1347,9 +1347,9 @@ void *read_object_with_reference(const u\n \t}\n }\n \n-static char *write_sha1_file_prepare(void *buf, unsigned long len,\n-                                     const char *type, unsigned char *sha1,\n-                                     unsigned char *hdr, int *hdrlen)\n+static void write_sha1_file_prepare(void *buf, unsigned long len,\n+                                    const char *type, unsigned char *sha1,\n+                                    unsigned char *hdr, int *hdrlen)\n {\n \tSHA_CTX c;\n \n@@ -1361,8 +1361,6 @@ static char *write_sha1_file_prepare(voi\n \tSHA1_Update(&c, hdr, *hdrlen);\n \tSHA1_Update(&c, buf, len);\n \tSHA1_Final(sha1, &c);\n-\n-\treturn sha1_file_name(sha1);\n }\n \n /*\n@@ -1521,7 +1519,8 @@ int write_sha1_file(void *buf, unsigned \n \t/* Normally if we have it in the pack then we do not bother writing\n \t * it out into .git/objects/??/?{38} file.\n \t */\n-\tfilename = write_sha1_file_prepare(buf, len, type, sha1, hdr, &hdrlen);\n+\twrite_sha1_file_prepare(buf, len, type, sha1, hdr, &hdrlen);\n+\tfilename = sha1_file_name(sha1);\n \tif (returnsha1)\n \t\thashcpy(returnsha1, sha1);\n \tif (has_sha1_file(sha1))\n-- \n1.4.3.rc2.gdce3\n"}]}