Skip to content

Commit

Permalink
for_each_recent_reflog_ent(): simplify opening of a reflog file
Browse files Browse the repository at this point in the history
There is no reason to use a temporary variable logfile.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 8, 2013
1 parent 9a7a183 commit 7ae07c1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7ae07c1

Please sign in to comment.