@@ -168,6 +168,35 @@ void test_merge_workdir_simple__automerge(void)
168168 git_index_free (index );
169169}
170170
171+ void test_merge_workdir_simple__index_reload (void )
172+ {
173+ git_repository * tmp_repo ;
174+ git_annotated_commit * their_heads [1 ];
175+ git_oid their_oid ;
176+ git_index_entry entry = {{0 }};
177+ git_index * tmp_index ;
178+
179+ cl_git_pass (git_repository_open (& tmp_repo , git_repository_workdir (repo )));
180+ cl_git_pass (git_repository_index (& tmp_index , tmp_repo ));
181+ cl_git_pass (git_index_read (repo_index , 0 ));
182+
183+ entry .mode = GIT_FILEMODE_BLOB ;
184+ cl_git_pass (git_oid_fromstr (& entry .id , "11deab00b2d3a6f5a3073988ac050c2d7b6655e2" ));
185+ entry .path = "automergeable.txt" ;
186+ cl_git_pass (git_index_add (repo_index , & entry ));
187+
188+ cl_git_pass (git_index_add_bypath (tmp_index , "automergeable.txt" ));
189+ cl_git_pass (git_index_write (tmp_index ));
190+
191+ cl_git_pass (git_oid_fromstr (& their_oid , THEIRS_SIMPLE_OID ));
192+ cl_git_pass (git_annotated_commit_lookup (& their_heads [0 ], repo , & their_oid ));
193+ cl_git_pass (git_merge (repo , (const git_annotated_commit * * )their_heads , 1 , NULL , NULL ));
194+
195+ git_index_free (tmp_index );
196+ git_repository_free (tmp_repo );
197+ git_annotated_commit_free (their_heads [0 ]);
198+ }
199+
171200void test_merge_workdir_simple__automerge_crlf (void )
172201{
173202#ifdef GIT_WIN32
0 commit comments