mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-12 01:15:09 +00:00
index: make git_index_new() work with a NULL path
This commit is contained in:
parent
353e991679
commit
69c068c79f
@ -259,7 +259,7 @@ int git_index_open(git_index **index_out, const char *index_path)
|
|||||||
{
|
{
|
||||||
git_index *index;
|
git_index *index;
|
||||||
|
|
||||||
assert(index_out && index_path);
|
assert(index_out);
|
||||||
|
|
||||||
index = git__calloc(1, sizeof(git_index));
|
index = git__calloc(1, sizeof(git_index));
|
||||||
GITERR_CHECK_ALLOC(index);
|
GITERR_CHECK_ALLOC(index);
|
||||||
|
11
tests-clar/index/inmemory.c
Normal file
11
tests-clar/index/inmemory.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include "clar_libgit2.h"
|
||||||
|
|
||||||
|
void test_index_inmemory__can_create_an_inmemory_index(void)
|
||||||
|
{
|
||||||
|
git_index *index;
|
||||||
|
|
||||||
|
cl_git_pass(git_index_new(&index));
|
||||||
|
cl_assert_equal_i(0, git_index_entrycount(index));
|
||||||
|
|
||||||
|
git_index_free(index);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user