Skip to content

Commit 524127a

Browse files
mhaggergitster
authored andcommitted
expire_reflog(): rename "ref" parameter to "refname"
This is our usual convention. Signed-off-by: Michael Haggerty <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55dfc8d commit 524127a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

builtin/reflog.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int push_tip_to_list(const char *refname, const unsigned char *sha1, int
349349
return 0;
350350
}
351351

352-
static int expire_reflog(const char *ref, const unsigned char *sha1,
352+
static int expire_reflog(const char *refname, const unsigned char *sha1,
353353
struct cmd_reflog_expire_cb *cmd)
354354
{
355355
struct expire_reflog_cb cb;
@@ -365,20 +365,20 @@ static int expire_reflog(const char *ref, const unsigned char *sha1,
365365
* we take the lock for the ref itself to prevent it from
366366
* getting updated.
367367
*/
368-
lock = lock_any_ref_for_update(ref, sha1, 0, NULL);
368+
lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
369369
if (!lock)
370-
return error("cannot lock ref '%s'", ref);
371-
log_file = git_pathdup("logs/%s", ref);
372-
if (!reflog_exists(ref))
370+
return error("cannot lock ref '%s'", refname);
371+
log_file = git_pathdup("logs/%s", refname);
372+
if (!reflog_exists(refname))
373373
goto finish;
374374
if (!cmd->dry_run) {
375-
newlog_path = git_pathdup("logs/%s.lock", ref);
375+
newlog_path = git_pathdup("logs/%s.lock", refname);
376376
cb.newlog = fopen(newlog_path, "w");
377377
}
378378

379379
cb.cmd = cmd;
380380

381-
if (!cmd->expire_unreachable || !strcmp(ref, "HEAD")) {
381+
if (!cmd->expire_unreachable || !strcmp(refname, "HEAD")) {
382382
tip_commit = NULL;
383383
cb.unreachable_expire_kind = UE_HEAD;
384384
} else {
@@ -407,7 +407,7 @@ static int expire_reflog(const char *ref, const unsigned char *sha1,
407407
mark_reachable(&cb);
408408
}
409409

410-
for_each_reflog_ent(ref, expire_reflog_ent, &cb);
410+
for_each_reflog_ent(refname, expire_reflog_ent, &cb);
411411

412412
if (cb.unreachable_expire_kind != UE_ALWAYS) {
413413
if (cb.unreachable_expire_kind == UE_HEAD) {

0 commit comments

Comments
 (0)