Skip to content

Commit 227d2fa

Browse files
committed
Merge branch 'ps/remote-rename-fix' into next
"git remote rename origin upstream" failed to move origin/HEAD to upstream/HEAD when origin/HEAD is unborn and performed other renames extremely inefficiently, which has been corrected. * ps/remote-rename-fix: builtin/remote: only iterate through refs that are to be renamed builtin/remote: rework how remote refs get renamed builtin/remote: determine whether refs need renaming early on builtin/remote: fix sign comparison warnings refs: simplify logic when migrating reflog entries refs: pass refname when invoking reflog entry callback
2 parents 8068e2a + 16c4fa2 commit 227d2fa

19 files changed

+372
-200
lines changed

builtin/fsck.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,12 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
503503
}
504504
}
505505

506-
static int fsck_handle_reflog_ent(struct object_id *ooid, struct object_id *noid,
506+
static int fsck_handle_reflog_ent(const char *refname,
507+
struct object_id *ooid, struct object_id *noid,
507508
const char *email UNUSED,
508509
timestamp_t timestamp, int tz UNUSED,
509-
const char *message UNUSED, void *cb_data)
510+
const char *message UNUSED, void *cb_data UNUSED)
510511
{
511-
const char *refname = cb_data;
512-
513512
if (verbose)
514513
fprintf_ln(stderr, _("Checking reflog %s->%s"),
515514
oid_to_hex(ooid), oid_to_hex(noid));
@@ -526,7 +525,7 @@ static int fsck_handle_reflog(const char *logname, void *cb_data)
526525
strbuf_worktree_ref(cb_data, &refname, logname);
527526
refs_for_each_reflog_ent(get_main_ref_store(the_repository),
528527
refname.buf, fsck_handle_reflog_ent,
529-
refname.buf);
528+
NULL);
530529
strbuf_release(&refname);
531530
return 0;
532531
}

builtin/gc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ struct count_reflog_entries_data {
312312
size_t limit;
313313
};
314314

315-
static int count_reflog_entries(struct object_id *old_oid, struct object_id *new_oid,
315+
static int count_reflog_entries(const char *refname UNUSED,
316+
struct object_id *old_oid, struct object_id *new_oid,
316317
const char *committer, timestamp_t timestamp,
317318
int tz, const char *msg, void *cb_data)
318319
{

0 commit comments

Comments
 (0)