@@ -2431,7 +2431,7 @@ static int write_merge_head(
24312431 assert (repo && heads );
24322432
24332433 if ((error = git_buf_joinpath (& file_path , repo -> gitdir , GIT_MERGE_HEAD_FILE )) < 0 ||
2434- (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_FORCE , GIT_MERGE_FILE_MODE )) < 0 )
2434+ (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_CREATE_LEADING_DIRS , GIT_MERGE_FILE_MODE )) < 0 )
24352435 goto cleanup ;
24362436
24372437 for (i = 0 ; i < heads_len ; i ++ ) {
@@ -2459,7 +2459,7 @@ static int write_merge_mode(git_repository *repo)
24592459 assert (repo );
24602460
24612461 if ((error = git_buf_joinpath (& file_path , repo -> gitdir , GIT_MERGE_MODE_FILE )) < 0 ||
2462- (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_FORCE , GIT_MERGE_FILE_MODE )) < 0 )
2462+ (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_CREATE_LEADING_DIRS , GIT_MERGE_FILE_MODE )) < 0 )
24632463 goto cleanup ;
24642464
24652465 if ((error = git_filebuf_write (& file , "no-ff" , 5 )) < 0 )
@@ -2690,7 +2690,7 @@ static int write_merge_msg(
26902690 entries [i ].merge_head = heads [i ];
26912691
26922692 if ((error = git_buf_joinpath (& file_path , repo -> gitdir , GIT_MERGE_MSG_FILE )) < 0 ||
2693- (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_FORCE , GIT_MERGE_FILE_MODE )) < 0 ||
2693+ (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_CREATE_LEADING_DIRS , GIT_MERGE_FILE_MODE )) < 0 ||
26942694 (error = git_filebuf_write (& file , "Merge " , 6 )) < 0 )
26952695 goto cleanup ;
26962696
0 commit comments