@@ -989,15 +989,15 @@ enum ref_worktree_type parse_worktree_ref(const char *maybe_worktree_ref,
989989 return REF_WORKTREE_SHARED ;
990990}
991991
992- long get_files_ref_lock_timeout_ms (void )
992+ long get_files_ref_lock_timeout_ms (struct repository * repo )
993993{
994994 static int configured = 0 ;
995995
996996 /* The default timeout is 100 ms: */
997997 static int timeout_ms = 100 ;
998998
999999 if (!configured ) {
1000- repo_config_get_int (the_repository , "core.filesreflocktimeout" , & timeout_ms );
1000+ repo_config_get_int (repo , "core.filesreflocktimeout" , & timeout_ms );
10011001 configured = 1 ;
10021002 }
10031003
@@ -1472,7 +1472,7 @@ int ref_transaction_create(struct ref_transaction *transaction,
14721472 return 1 ;
14731473 }
14741474 return ref_transaction_update (transaction , refname , new_oid ,
1475- null_oid (the_hash_algo ), new_target , NULL , flags ,
1475+ null_oid (transaction -> ref_store -> repo -> hash_algo ), new_target , NULL , flags ,
14761476 msg , err );
14771477}
14781478
@@ -1491,7 +1491,7 @@ int ref_transaction_delete(struct ref_transaction *transaction,
14911491 if (old_target && !(flags & REF_NO_DEREF ))
14921492 BUG ("delete cannot operate on symrefs with deref mode" );
14931493 return ref_transaction_update (transaction , refname ,
1494- null_oid (the_hash_algo ), old_oid ,
1494+ null_oid (transaction -> ref_store -> repo -> hash_algo ), old_oid ,
14951495 NULL , old_target , flags ,
14961496 msg , err );
14971497}
@@ -2379,7 +2379,7 @@ struct ref_store *repo_get_submodule_ref_store(struct repository *repo,
23792379 subrepo = xmalloc (sizeof (* subrepo ));
23802380
23812381 if (repo_submodule_init (subrepo , repo , submodule ,
2382- null_oid (the_hash_algo ))) {
2382+ null_oid (repo -> hash_algo ))) {
23832383 free (subrepo );
23842384 goto done ;
23852385 }
@@ -2571,14 +2571,14 @@ static int transaction_hook_feed_stdin(int hook_stdin_fd, void *pp_cb, void *pp_
25712571 strbuf_reset (buf );
25722572
25732573 if (!(update -> flags & REF_HAVE_OLD ))
2574- strbuf_addf (buf , "%s " , oid_to_hex (null_oid (the_hash_algo )));
2574+ strbuf_addf (buf , "%s " , oid_to_hex (null_oid (transaction -> ref_store -> repo -> hash_algo )));
25752575 else if (update -> old_target )
25762576 strbuf_addf (buf , "ref:%s " , update -> old_target );
25772577 else
25782578 strbuf_addf (buf , "%s " , oid_to_hex (& update -> old_oid ));
25792579
25802580 if (!(update -> flags & REF_HAVE_NEW ))
2581- strbuf_addf (buf , "%s " , oid_to_hex (null_oid (the_hash_algo )));
2581+ strbuf_addf (buf , "%s " , oid_to_hex (null_oid (transaction -> ref_store -> repo -> hash_algo )));
25822582 else if (update -> new_target )
25832583 strbuf_addf (buf , "ref:%s " , update -> new_target );
25842584 else
@@ -3146,6 +3146,7 @@ struct migration_data {
31463146static int migrate_one_ref (const struct reference * ref , void * cb_data )
31473147{
31483148 struct migration_data * data = cb_data ;
3149+ const struct git_hash_algo * hash_algo = data -> transaction -> ref_store -> repo -> hash_algo ;
31493150 struct strbuf symref_target = STRBUF_INIT ;
31503151 int ret ;
31513152
@@ -3154,7 +3155,7 @@ static int migrate_one_ref(const struct reference *ref, void *cb_data)
31543155 if (ret < 0 )
31553156 goto done ;
31563157
3157- ret = ref_transaction_update (data -> transaction , ref -> name , NULL , null_oid (the_hash_algo ),
3158+ ret = ref_transaction_update (data -> transaction , ref -> name , NULL , null_oid (hash_algo ),
31583159 symref_target .buf , NULL ,
31593160 REF_SKIP_CREATE_REFLOG | REF_NO_DEREF , NULL , data -> errbuf );
31603161 if (ret < 0 )
0 commit comments