Skip to content

Commit 006f3f2

Browse files
stefanbellergitster
authored andcommitted
replace-objects: evaluate replacement refs without using the object store
Pass DO_FOR_EACH_INCLUDE_BROKEN when iterating over replacement refs so that the iteration does not require opening the named objects from the object store. This avoids a dependency cycle between object access and replace ref iteration. Moreover the ref subsystem has not been migrated yet to access the object store via passed in repository objects. As a result, without this patch, iterating over replace refs in a repository other than the_repository it produces errors: error: refs/replace/3afabef75c627b894cccc3bcae86837abc7c32fe does not point to a valid object! Noticed while adapting the object store (and in particular its evaluation of replace refs) to handle arbitrary repositories. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3c96aa9 commit 006f3f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ int for_each_replace_ref(each_ref_fn fn, void *cb_data)
13941394
return do_for_each_ref(get_main_ref_store(),
13951395
git_replace_ref_base, fn,
13961396
strlen(git_replace_ref_base),
1397-
0, cb_data);
1397+
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
13981398
}
13991399

14001400
int for_each_namespaced_ref(each_ref_fn fn, void *cb_data)

0 commit comments

Comments
 (0)