1
0
mirror of https://github.com/git/git synced 2024-07-04 16:48:40 +00:00

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 <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2013-03-08 10:45:25 -08:00
parent 9a7a183bd2
commit 7ae07c1bd7

4
refs.c
View File

@ -2320,13 +2320,11 @@ static int show_one_reflog_ent(struct strbuf *sb, each_reflog_ent_fn fn, void *c
int for_each_recent_reflog_ent(const char *refname, each_reflog_ent_fn fn, long ofs, void *cb_data)
{
const char *logfile;
FILE *logfp;
struct strbuf sb = STRBUF_INIT;
int ret = 0;
logfile = git_path("logs/%s", refname);
logfp = fopen(logfile, "r");
logfp = fopen(git_path("logs/%s", refname), "r");
if (!logfp)
return -1;