File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -2861,15 +2861,15 @@ static int write_entries(git_index *index, git_filebuf *file)
28612861{
28622862 int error = 0 ;
28632863 size_t i ;
2864- git_vector case_sorted , * entries ;
2864+ git_vector case_sorted = GIT_VECTOR_INIT , * entries = NULL ;
28652865 git_index_entry * entry ;
28662866 const char * last = NULL ;
28672867
28682868 /* If index->entries is sorted case-insensitively, then we need
28692869 * to re-sort it case-sensitively before writing */
28702870 if (index -> ignore_case ) {
28712871 if ((error = git_vector_dup (& case_sorted , & index -> entries , git_index_entry_cmp )) < 0 )
2872- return error ;
2872+ goto done ;
28732873
28742874 git_vector_sort (& case_sorted );
28752875 entries = & case_sorted ;
@@ -2887,9 +2887,8 @@ static int write_entries(git_index *index, git_filebuf *file)
28872887 last = entry -> path ;
28882888 }
28892889
2890- if (index -> ignore_case )
2891- git_vector_free (& case_sorted );
2892-
2890+ done :
2891+ git_vector_free (& case_sorted );
28932892 return error ;
28942893}
28952894
You can’t perform that action at this time.
0 commit comments