summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-08 18:45:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-08 22:00:16 (GMT)
commit7ae07c1bd7bdab0bf0b36190c94e761cc593a890 (patch)
treeb7db659a2e72c3e0c652433ec8fb54779259628e /refs.c
parent9a7a183bd216fc7f824460e1f6d27886938a6152 (diff)
downloadgit-7ae07c1bd7bdab0bf0b36190c94e761cc593a890.zip
git-7ae07c1bd7bdab0bf0b36190c94e761cc593a890.tar.gz
git-7ae07c1bd7bdab0bf0b36190c94e761cc593a890.tar.bz2
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>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 9f702a7..e302521 100644
--- 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;