@@ -198,10 +198,10 @@ static struct rerere_id *new_rerere_id(unsigned char *sha1)
198198 * work on (i.e. what is left by the previous invocation of "git
199199 * rerere" during the current conflict resolution session).
200200 */
201- static void read_rr (struct string_list * rr )
201+ static void read_rr (struct repository * r , struct string_list * rr )
202202{
203203 struct strbuf buf = STRBUF_INIT ;
204- FILE * in = fopen_or_warn (git_path_merge_rr (the_repository ), "r" );
204+ FILE * in = fopen_or_warn (git_path_merge_rr (r ), "r" );
205205
206206 if (!in )
207207 return ;
@@ -593,7 +593,7 @@ int rerere_remaining(struct repository *r, struct string_list *merge_rr)
593593{
594594 int i ;
595595
596- if (setup_rerere (merge_rr , RERERE_READONLY ))
596+ if (setup_rerere (r , merge_rr , RERERE_READONLY ))
597597 return 0 ;
598598 if (read_index (r -> index ) < 0 )
599599 return error (_ ("index file corrupt" ));
@@ -882,7 +882,7 @@ static int is_rerere_enabled(void)
882882 return 1 ;
883883}
884884
885- int setup_rerere (struct string_list * merge_rr , int flags )
885+ int setup_rerere (struct repository * r , struct string_list * merge_rr , int flags )
886886{
887887 int fd ;
888888
@@ -896,9 +896,9 @@ int setup_rerere(struct string_list *merge_rr, int flags)
896896 fd = 0 ;
897897 else
898898 fd = hold_lock_file_for_update (& write_lock ,
899- git_path_merge_rr (the_repository ),
899+ git_path_merge_rr (r ),
900900 LOCK_DIE_ON_ERROR );
901- read_rr (merge_rr );
901+ read_rr (r , merge_rr );
902902 return fd ;
903903}
904904
@@ -912,7 +912,7 @@ int repo_rerere(struct repository *r, int flags)
912912 struct string_list merge_rr = STRING_LIST_INIT_DUP ;
913913 int fd , status ;
914914
915- fd = setup_rerere (& merge_rr , flags );
915+ fd = setup_rerere (r , & merge_rr , flags );
916916 if (fd < 0 )
917917 return 0 ;
918918 status = do_plain_rerere (r , & merge_rr , fd );
@@ -1110,7 +1110,7 @@ int rerere_forget(struct repository *r, struct pathspec *pathspec)
11101110 if (read_index (r -> index ) < 0 )
11111111 return error (_ ("index file corrupt" ));
11121112
1113- fd = setup_rerere (& merge_rr , RERERE_NOAUTOUPDATE );
1113+ fd = setup_rerere (r , & merge_rr , RERERE_NOAUTOUPDATE );
11141114 if (fd < 0 )
11151115 return 0 ;
11161116
@@ -1178,7 +1178,7 @@ static void prune_one(struct rerere_id *id,
11781178 unlink_rr_item (id );
11791179}
11801180
1181- void rerere_gc (struct string_list * rr )
1181+ void rerere_gc (struct repository * r , struct string_list * rr )
11821182{
11831183 struct string_list to_remove = STRING_LIST_INIT_DUP ;
11841184 DIR * dir ;
@@ -1188,7 +1188,7 @@ void rerere_gc(struct string_list *rr)
11881188 timestamp_t cutoff_noresolve = now - 15 * 86400 ;
11891189 timestamp_t cutoff_resolve = now - 60 * 86400 ;
11901190
1191- if (setup_rerere (rr , 0 ) < 0 )
1191+ if (setup_rerere (r , rr , 0 ) < 0 )
11921192 return ;
11931193
11941194 git_config_get_expiry_in_days ("gc.rerereresolved" , & cutoff_resolve , now );
@@ -1236,11 +1236,11 @@ void rerere_gc(struct string_list *rr)
12361236 *
12371237 * NEEDSWORK: shouldn't we be calling this from "reset --hard"?
12381238 */
1239- void rerere_clear (struct string_list * merge_rr )
1239+ void rerere_clear (struct repository * r , struct string_list * merge_rr )
12401240{
12411241 int i ;
12421242
1243- if (setup_rerere (merge_rr , 0 ) < 0 )
1243+ if (setup_rerere (r , merge_rr , 0 ) < 0 )
12441244 return ;
12451245
12461246 for (i = 0 ; i < merge_rr -> nr ; i ++ ) {
@@ -1250,6 +1250,6 @@ void rerere_clear(struct string_list *merge_rr)
12501250 rmdir (rerere_path (id , NULL ));
12511251 }
12521252 }
1253- unlink_or_warn (git_path_merge_rr (the_repository ));
1253+ unlink_or_warn (git_path_merge_rr (r ));
12541254 rollback_lock_file (& write_lock );
12551255}
0 commit comments