File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3239,9 +3239,6 @@ int git_merge(
32393239
32403240 assert (repo && their_heads );
32413241
3242- git_repository_index (& index , repo );
3243- git_index_read (index , 0 );
3244-
32453242 if (their_heads_len != 1 ) {
32463243 giterr_set (GITERR_MERGE , "can only merge a single branch" );
32473244 return -1 ;
@@ -3258,6 +3255,10 @@ int git_merge(
32583255 & checkout_strategy )) < 0 )
32593256 goto done ;
32603257
3258+ if ((error = git_repository_index (& index , repo ) < 0 ) ||
3259+ (error = git_index_read (index , 0 ) < 0 ))
3260+ goto done ;
3261+
32613262 /* Write the merge setup files to the repository. */
32623263 if ((error = git_annotated_commit_from_head (& our_head , repo )) < 0 ||
32633264 (error = git_merge__setup (repo , our_head , their_heads ,
You can’t perform that action at this time.
0 commit comments