Skip to content

Commit 972a915

Browse files
Rene ScharfeJunio C Hamano
authored andcommitted
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>
1 parent 29f049a commit 972a915

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sha1_file.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,9 @@ void *read_object_with_reference(const unsigned char *sha1,
13471347
}
13481348
}
13491349

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)
13531353
{
13541354
SHA_CTX c;
13551355

@@ -1361,8 +1361,6 @@ static char *write_sha1_file_prepare(void *buf, unsigned long len,
13611361
SHA1_Update(&c, hdr, *hdrlen);
13621362
SHA1_Update(&c, buf, len);
13631363
SHA1_Final(sha1, &c);
1364-
1365-
return sha1_file_name(sha1);
13661364
}
13671365

13681366
/*
@@ -1521,7 +1519,8 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
15211519
/* Normally if we have it in the pack then we do not bother writing
15221520
* it out into .git/objects/??/?{38} file.
15231521
*/
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);
15251524
if (returnsha1)
15261525
hashcpy(returnsha1, sha1);
15271526
if (has_sha1_file(sha1))

0 commit comments

Comments
 (0)