@@ -245,9 +245,9 @@ static struct option builtin_merge_options[] = {
245245/* Cleans up metadata that is uninteresting after a succeeded merge. */
246246static void drop_save (void )
247247{
248- unlink (git_path_merge_head ());
249- unlink (git_path_merge_msg ());
250- unlink (git_path_merge_mode ());
248+ unlink (git_path_merge_head (the_repository ));
249+ unlink (git_path_merge_msg (the_repository ));
250+ unlink (git_path_merge_mode (the_repository ));
251251}
252252
253253static int save_state (struct object_id * stash )
@@ -380,7 +380,7 @@ static void squash_message(struct commit *commit, struct commit_list *remotehead
380380 oid_to_hex (& commit -> object .oid ));
381381 pretty_print_commit (& ctx , commit , & out );
382382 }
383- write_file_buf (git_path_squash_msg (), out .buf , out .len );
383+ write_file_buf (git_path_squash_msg (the_repository ), out .buf , out .len );
384384 strbuf_release (& out );
385385}
386386
@@ -741,7 +741,7 @@ static void add_strategies(const char *string, unsigned attr)
741741
742742static void read_merge_msg (struct strbuf * msg )
743743{
744- const char * filename = git_path_merge_msg ();
744+ const char * filename = git_path_merge_msg (the_repository );
745745 strbuf_reset (msg );
746746 if (strbuf_read_file (msg , filename , 0 ) < 0 )
747747 die_errno (_ ("Could not read from '%s'" ), filename );
@@ -778,18 +778,18 @@ static void prepare_to_commit(struct commit_list *remoteheads)
778778 if (signoff )
779779 append_signoff (& msg , ignore_non_trailer (msg .buf , msg .len ), 0 );
780780 write_merge_heads (remoteheads );
781- write_file_buf (git_path_merge_msg (), msg .buf , msg .len );
781+ write_file_buf (git_path_merge_msg (the_repository ), msg .buf , msg .len );
782782 if (run_commit_hook (0 < option_edit , get_index_file (), "prepare-commit-msg" ,
783- git_path_merge_msg (), "merge" , NULL ))
783+ git_path_merge_msg (the_repository ), "merge" , NULL ))
784784 abort_commit (remoteheads , NULL );
785785 if (0 < option_edit ) {
786- if (launch_editor (git_path_merge_msg (), NULL , NULL ))
786+ if (launch_editor (git_path_merge_msg (the_repository ), NULL , NULL ))
787787 abort_commit (remoteheads , NULL );
788788 }
789789
790790 if (verify_msg && run_commit_hook (0 < option_edit , get_index_file (),
791791 "commit-msg" ,
792- git_path_merge_msg (), NULL ))
792+ git_path_merge_msg (the_repository ), NULL ))
793793 abort_commit (remoteheads , NULL );
794794
795795 read_merge_msg (& msg );
@@ -859,7 +859,7 @@ static int suggest_conflicts(void)
859859 FILE * fp ;
860860 struct strbuf msgbuf = STRBUF_INIT ;
861861
862- filename = git_path_merge_msg ();
862+ filename = git_path_merge_msg (the_repository );
863863 fp = xfopen (filename , "a" );
864864
865865 append_conflicts_hint (& msgbuf );
@@ -939,20 +939,21 @@ static void write_merge_heads(struct commit_list *remoteheads)
939939 }
940940 strbuf_addf (& buf , "%s\n" , oid_to_hex (oid ));
941941 }
942- write_file_buf (git_path_merge_head (), buf .buf , buf .len );
942+ write_file_buf (git_path_merge_head (the_repository ), buf .buf , buf .len );
943943
944944 strbuf_reset (& buf );
945945 if (fast_forward == FF_NO )
946946 strbuf_addstr (& buf , "no-ff" );
947- write_file_buf (git_path_merge_mode (), buf .buf , buf .len );
947+ write_file_buf (git_path_merge_mode (the_repository ), buf .buf , buf .len );
948948 strbuf_release (& buf );
949949}
950950
951951static void write_merge_state (struct commit_list * remoteheads )
952952{
953953 write_merge_heads (remoteheads );
954954 strbuf_addch (& merge_msg , '\n' );
955- write_file_buf (git_path_merge_msg (), merge_msg .buf , merge_msg .len );
955+ write_file_buf (git_path_merge_msg (the_repository ), merge_msg .buf ,
956+ merge_msg .len );
956957}
957958
958959static int default_edit_option (void )
@@ -1035,7 +1036,7 @@ static void handle_fetch_head(struct commit_list **remotes, struct strbuf *merge
10351036 if (!merge_names )
10361037 merge_names = & fetch_head_file ;
10371038
1038- filename = git_path_fetch_head ();
1039+ filename = git_path_fetch_head (the_repository );
10391040 fd = open (filename , O_RDONLY );
10401041 if (fd < 0 )
10411042 die_errno (_ ("could not open '%s' for reading" ), filename );
@@ -1209,7 +1210,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
12091210 usage_msg_opt (_ ("--abort expects no arguments" ),
12101211 builtin_merge_usage , builtin_merge_options );
12111212
1212- if (!file_exists (git_path_merge_head ()))
1213+ if (!file_exists (git_path_merge_head (the_repository )))
12131214 die (_ ("There is no merge to abort (MERGE_HEAD missing)." ));
12141215
12151216 /* Invoke 'git reset --merge' */
@@ -1225,7 +1226,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
12251226 usage_msg_opt (_ ("--continue expects no arguments" ),
12261227 builtin_merge_usage , builtin_merge_options );
12271228
1228- if (!file_exists (git_path_merge_head ()))
1229+ if (!file_exists (git_path_merge_head (the_repository )))
12291230 die (_ ("There is no merge in progress (MERGE_HEAD missing)." ));
12301231
12311232 /* Invoke 'git commit' */
@@ -1236,7 +1237,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
12361237 if (read_cache_unmerged ())
12371238 die_resolve_conflict ("merge" );
12381239
1239- if (file_exists (git_path_merge_head ())) {
1240+ if (file_exists (git_path_merge_head (the_repository ))) {
12401241 /*
12411242 * There is no unmerged entry, don't advise 'git
12421243 * add/rm <file>', just 'git commit'.
@@ -1247,7 +1248,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
12471248 else
12481249 die (_ ("You have not concluded your merge (MERGE_HEAD exists)." ));
12491250 }
1250- if (file_exists (git_path_cherry_pick_head ())) {
1251+ if (file_exists (git_path_cherry_pick_head (the_repository ))) {
12511252 if (advice_resolve_conflict )
12521253 die (_ ("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
12531254 "Please, commit your changes before you merge." ));
0 commit comments