expire_reflog(): rename "ref" parameter to "refname"
This is our usual convention. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Dec 12, 2014 at 09:56 UTC
524127afbf8b98350bcebe3fc1f7600fce191716
1 file changed
+8
-8
builtin/reflog.c
+8
-8
@@ -349,7 +349,7 @@ static int push_tip_to_list(const char *refname, const unsigned char *sha1, int
349
return 0;
350
}
351
352
-static int expire_reflog(const char *ref, const unsigned char *sha1,
352
+static int expire_reflog(const char *refname, const unsigned char *sha1,
353
struct cmd_reflog_expire_cb *cmd)
354
{
355
struct expire_reflog_cb cb;
@@ -365,20 +365,20 @@ static int expire_reflog(const char *ref, const unsigned char *sha1,
365
* we take the lock for the ref itself to prevent it from
366
* getting updated.
367
*/
368
- lock = lock_any_ref_for_update(ref, sha1, 0, NULL);
368
+ lock = lock_any_ref_for_update(refname, sha1, 0, NULL);
369
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))
373
goto finish;
374
if (!cmd->dry_run) {
375
- newlog_path = git_pathdup("logs/%s.lock", ref);
375
+ newlog_path = git_pathdup("logs/%s.lock", refname);
376
cb.newlog = fopen(newlog_path, "w");
377
}
378
379
cb.cmd = cmd;
380
381
- if (!cmd->expire_unreachable || !strcmp(ref, "HEAD")) {
381
+ if (!cmd->expire_unreachable || !strcmp(refname, "HEAD")) {
382
tip_commit = NULL;
383
cb.unreachable_expire_kind = UE_HEAD;
384
} else {
@@ -407,7 +407,7 @@ static int expire_reflog(const char *ref, const unsigned char *sha1,
407
mark_reachable(&cb);
408
}
409
410
- for_each_reflog_ent(ref, expire_reflog_ent, &cb);
410
+ for_each_reflog_ent(refname, expire_reflog_ent, &cb);
411
412
if (cb.unreachable_expire_kind != UE_ALWAYS) {
413
if (cb.unreachable_expire_kind == UE_HEAD) {