]> granicus.if.org Git - git/commitdiff
for_each_recent_reflog_ent(): simplify opening of a reflog file
authorJunio C Hamano <gitster@pobox.com>
Fri, 8 Mar 2013 18:45:25 +0000 (10:45 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Mar 2013 22:00:16 +0000 (14:00 -0800)
There is no reason to use a temporary variable logfile.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c

diff --git a/refs.c b/refs.c
index 9f702a763db0a5d6ad6b48d35617876d2201f0b9..e302521431201ddbb7dccb7e88e7eeb56c636730 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -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;