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>
Junio C Hamano committed
Mar 8, 2013 at 10:45 UTC
7ae07c1bd7bdab0bf0b36190c94e761cc593a890
1 file changed
+1
-3
refs.c
+1
-3
@@ -2320,13 +2320,11 @@ static int show_one_reflog_ent(struct strbuf *sb, each_reflog_ent_fn fn, void *c
2320
2321
int for_each_recent_reflog_ent(const char *refname, each_reflog_ent_fn fn, long ofs, void *cb_data)
2322
{
2323
- const char *logfile;
2323
FILE *logfp;
2324
struct strbuf sb = STRBUF_INIT;
2325
int ret = 0;
2326
2328
- logfile = git_path("logs/%s", refname);
2329
- logfp = fopen(logfile, "r");
2327
+ logfp = fopen(git_path("logs/%s", refname), "r");
2328
if (!logfp)
2329
return -1;
2330