Skip to content

Commit 7ae07c1

Browse files
committed
for_each_recent_reflog_ent(): simplify opening of a reflog file
There is no reason to use a temporary variable logfile. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9a7a183 commit 7ae07c1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

refs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,13 +2320,11 @@ static int show_one_reflog_ent(struct strbuf *sb, each_reflog_ent_fn fn, void *c
23202320

23212321
int for_each_recent_reflog_ent(const char *refname, each_reflog_ent_fn fn, long ofs, void *cb_data)
23222322
{
2323-
const char *logfile;
23242323
FILE *logfp;
23252324
struct strbuf sb = STRBUF_INIT;
23262325
int ret = 0;
23272326

2328-
logfile = git_path("logs/%s", refname);
2329-
logfp = fopen(logfile, "r");
2327+
logfp = fopen(git_path("logs/%s", refname), "r");
23302328
if (!logfp)
23312329
return -1;
23322330

0 commit comments

Comments
 (0)