mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 20:42:23 +00:00
Make index_insert keep existing case
In a case insensitive index, if you attempt to add a file from disk with a different case pattern, the old case pattern in the index should be preserved. This fixes that (and a couple of minor warnings).
This commit is contained in:
parent
1540b19990
commit
6ea999bb88
@ -734,8 +734,9 @@ static int index_insert(git_index *index, git_index_entry *entry, int replace)
|
||||
if (!replace || !existing)
|
||||
return git_vector_insert(&index->entries, entry);
|
||||
|
||||
/* exists, replace it */
|
||||
git__free((*existing)->path);
|
||||
/* exists, replace it (preserving name from existing entry) */
|
||||
git__free(entry->path);
|
||||
entry->path = (*existing)->path;
|
||||
git__free(*existing);
|
||||
*existing = entry;
|
||||
|
||||
|
@ -911,7 +911,6 @@ void test_diff_rename__case_changes_are_split(void)
|
||||
{
|
||||
git_index *index;
|
||||
git_tree *tree;
|
||||
git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
|
||||
git_diff_list *diff = NULL;
|
||||
diff_expects exp;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user