Skip to content

Commit c653e03

Browse files
stefanbellergitster
authored andcommitted
refs.c: let fprintf handle the formatting
Instead of calculating whether to put a plus or minus sign, offload the responsibilty to the fprintf function. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3581d79 commit c653e03

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

refs.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,12 +3972,9 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
39723972
printf("prune %s", message);
39733973
} else {
39743974
if (cb->newlog) {
3975-
char sign = (tz < 0) ? '-' : '+';
3976-
int zone = (tz < 0) ? (-tz) : tz;
3977-
fprintf(cb->newlog, "%s %s %s %lu %c%04d\t%s",
3975+
fprintf(cb->newlog, "%s %s %s %lu %+05d\t%s",
39783976
sha1_to_hex(osha1), sha1_to_hex(nsha1),
3979-
email, timestamp, sign, zone,
3980-
message);
3977+
email, timestamp, tz, message);
39813978
hashcpy(cb->last_kept_sha1, nsha1);
39823979
}
39833980
if (cb->flags & EXPIRE_REFLOGS_VERBOSE)

0 commit comments

Comments
 (0)