@@ -198,10 +198,10 @@ static struct rerere_id *new_rerere_id(unsigned char *sha1)
198
198
* work on (i.e. what is left by the previous invocation of "git
199
199
* rerere" during the current conflict resolution session).
200
200
*/
201
- static void read_rr (struct string_list * rr )
201
+ static void read_rr (struct repository * r , struct string_list * rr )
202
202
{
203
203
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" );
205
205
206
206
if (!in )
207
207
return ;
@@ -593,7 +593,7 @@ int rerere_remaining(struct repository *r, struct string_list *merge_rr)
593
593
{
594
594
int i ;
595
595
596
- if (setup_rerere (merge_rr , RERERE_READONLY ))
596
+ if (setup_rerere (r , merge_rr , RERERE_READONLY ))
597
597
return 0 ;
598
598
if (read_index (r -> index ) < 0 )
599
599
return error (_ ("index file corrupt" ));
@@ -882,7 +882,7 @@ static int is_rerere_enabled(void)
882
882
return 1 ;
883
883
}
884
884
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 )
886
886
{
887
887
int fd ;
888
888
@@ -896,9 +896,9 @@ int setup_rerere(struct string_list *merge_rr, int flags)
896
896
fd = 0 ;
897
897
else
898
898
fd = hold_lock_file_for_update (& write_lock ,
899
- git_path_merge_rr (the_repository ),
899
+ git_path_merge_rr (r ),
900
900
LOCK_DIE_ON_ERROR );
901
- read_rr (merge_rr );
901
+ read_rr (r , merge_rr );
902
902
return fd ;
903
903
}
904
904
@@ -912,7 +912,7 @@ int repo_rerere(struct repository *r, int flags)
912
912
struct string_list merge_rr = STRING_LIST_INIT_DUP ;
913
913
int fd , status ;
914
914
915
- fd = setup_rerere (& merge_rr , flags );
915
+ fd = setup_rerere (r , & merge_rr , flags );
916
916
if (fd < 0 )
917
917
return 0 ;
918
918
status = do_plain_rerere (r , & merge_rr , fd );
@@ -1110,7 +1110,7 @@ int rerere_forget(struct repository *r, struct pathspec *pathspec)
1110
1110
if (read_index (r -> index ) < 0 )
1111
1111
return error (_ ("index file corrupt" ));
1112
1112
1113
- fd = setup_rerere (& merge_rr , RERERE_NOAUTOUPDATE );
1113
+ fd = setup_rerere (r , & merge_rr , RERERE_NOAUTOUPDATE );
1114
1114
if (fd < 0 )
1115
1115
return 0 ;
1116
1116
@@ -1178,7 +1178,7 @@ static void prune_one(struct rerere_id *id,
1178
1178
unlink_rr_item (id );
1179
1179
}
1180
1180
1181
- void rerere_gc (struct string_list * rr )
1181
+ void rerere_gc (struct repository * r , struct string_list * rr )
1182
1182
{
1183
1183
struct string_list to_remove = STRING_LIST_INIT_DUP ;
1184
1184
DIR * dir ;
@@ -1188,7 +1188,7 @@ void rerere_gc(struct string_list *rr)
1188
1188
timestamp_t cutoff_noresolve = now - 15 * 86400 ;
1189
1189
timestamp_t cutoff_resolve = now - 60 * 86400 ;
1190
1190
1191
- if (setup_rerere (rr , 0 ) < 0 )
1191
+ if (setup_rerere (r , rr , 0 ) < 0 )
1192
1192
return ;
1193
1193
1194
1194
git_config_get_expiry_in_days ("gc.rerereresolved" , & cutoff_resolve , now );
@@ -1236,11 +1236,11 @@ void rerere_gc(struct string_list *rr)
1236
1236
*
1237
1237
* NEEDSWORK: shouldn't we be calling this from "reset --hard"?
1238
1238
*/
1239
- void rerere_clear (struct string_list * merge_rr )
1239
+ void rerere_clear (struct repository * r , struct string_list * merge_rr )
1240
1240
{
1241
1241
int i ;
1242
1242
1243
- if (setup_rerere (merge_rr , 0 ) < 0 )
1243
+ if (setup_rerere (r , merge_rr , 0 ) < 0 )
1244
1244
return ;
1245
1245
1246
1246
for (i = 0 ; i < merge_rr -> nr ; i ++ ) {
@@ -1250,6 +1250,6 @@ void rerere_clear(struct string_list *merge_rr)
1250
1250
rmdir (rerere_path (id , NULL ));
1251
1251
}
1252
1252
}
1253
- unlink_or_warn (git_path_merge_rr (the_repository ));
1253
+ unlink_or_warn (git_path_merge_rr (r ));
1254
1254
rollback_lock_file (& write_lock );
1255
1255
}
0 commit comments