Merge branch 'ps/remote-rename-fix'

"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
This commit is contained in:
Junio C Hamano
2025-08-21 13:46:58 -07:00
19 changed files with 372 additions and 200 deletions

View File

@@ -738,7 +738,8 @@ cleanup:
return ret;
}
static int reject_reflog_ent(struct object_id *ooid UNUSED,
static int reject_reflog_ent(const char *refname UNUSED,
struct object_id *ooid UNUSED,
struct object_id *noid UNUSED,
const char *email UNUSED,
timestamp_t timestamp UNUSED,
@@ -2207,7 +2208,8 @@ struct stash_entry_data {
size_t count;
};
static int collect_stash_entries(struct object_id *old_oid UNUSED,
static int collect_stash_entries(const char *refname UNUSED,
struct object_id *old_oid UNUSED,
struct object_id *new_oid,
const char *committer UNUSED,
timestamp_t timestamp UNUSED,