mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-21 14:27:04 +00:00
Merge pull request #528 from arrbee/valgrind-fixes-2
Valgrind fixes in smaller pieces
This commit is contained in:
commit
1d17507496
@ -120,7 +120,7 @@ int git_config_add_file(git_config *cfg, git_config_file *file, int priority)
|
|||||||
assert(cfg && file);
|
assert(cfg && file);
|
||||||
|
|
||||||
if ((error = file->open(file)) < GIT_SUCCESS)
|
if ((error = file->open(file)) < GIT_SUCCESS)
|
||||||
return git__rethrow(error, "Failed to open config file");
|
return git__throw(error, "Failed to open config file");
|
||||||
|
|
||||||
internal = git__malloc(sizeof(file_internal));
|
internal = git__malloc(sizeof(file_internal));
|
||||||
if (internal == NULL)
|
if (internal == NULL)
|
||||||
|
@ -510,6 +510,7 @@ int git_index_append2(git_index *index, const git_index_entry *source_entry)
|
|||||||
|
|
||||||
int git_index_remove(git_index *index, int position)
|
int git_index_remove(git_index *index, int position)
|
||||||
{
|
{
|
||||||
|
int error;
|
||||||
git_index_entry *entry;
|
git_index_entry *entry;
|
||||||
|
|
||||||
git_vector_sort(&index->entries);
|
git_vector_sort(&index->entries);
|
||||||
@ -517,7 +518,12 @@ int git_index_remove(git_index *index, int position)
|
|||||||
if (entry != NULL)
|
if (entry != NULL)
|
||||||
git_tree_cache_invalidate_path(index->tree, entry->path);
|
git_tree_cache_invalidate_path(index->tree, entry->path);
|
||||||
|
|
||||||
return git_vector_remove(&index->entries, (unsigned int)position);
|
error = git_vector_remove(&index->entries, (unsigned int)position);
|
||||||
|
|
||||||
|
if (error == GIT_SUCCESS)
|
||||||
|
index_entry_free(entry);
|
||||||
|
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_index_find(git_index *index, const char *path)
|
int git_index_find(git_index *index, const char *path)
|
||||||
|
@ -7,7 +7,6 @@ void test_object_commit_commitstagedfile__initialize(void)
|
|||||||
{
|
{
|
||||||
cl_fixture("treebuilder");
|
cl_fixture("treebuilder");
|
||||||
cl_git_pass(git_repository_init(&repo, "treebuilder/", 0));
|
cl_git_pass(git_repository_init(&repo, "treebuilder/", 0));
|
||||||
cl_git_pass(git_repository_open(&repo, "treebuilder/.git"));
|
|
||||||
cl_assert(repo != NULL);
|
cl_assert(repo != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user