Merge branch 'ps/copy-wo-the-repository'

The copy_file() and copy_file_with_time() functions have been
refactored to take a repository parameter, allowing the removal of the
implicit dependency on the global 'the_repository' variable in
'copy.c'.

* ps/copy-wo-the-repository:
  copy: drop dependency on `the_repository`
This commit is contained in:
Junio C Hamano
2026-07-27 09:09:00 -07:00
10 changed files with 24 additions and 20 deletions

View File

@@ -1739,7 +1739,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
goto out;
}
if (copy && log && copy_file(tmp_renamed_log.buf, sb_oldref.buf, 0644)) {
if (copy && log && copy_file(refs->base.repo, tmp_renamed_log.buf, sb_oldref.buf, 0644)) {
ret = error("unable to copy logfile logs/%s to logs/"TMP_RENAMED_LOG": %s",
oldrefname, strerror(errno));
goto out;