mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 23:54:50 +00:00

This also affects `git_index_add_bypath()` by providing a better error message and a specific error code when a directory is passed.
24 lines
494 B
C
24 lines
494 B
C
#include "clar_libgit2.h"
|
|
#include "repository.h"
|
|
#include "../submodule/submodule_helpers.h"
|
|
|
|
static git_repository *g_repo;
|
|
static git_index *g_idx;
|
|
|
|
void test_index_bypath__initialize(void)
|
|
{
|
|
g_repo = setup_fixture_submod2();
|
|
cl_git_pass(git_repository_index__weakptr(&g_idx, g_repo));
|
|
}
|
|
|
|
void test_index_bypath__cleanup(void)
|
|
{
|
|
g_repo = NULL;
|
|
g_idx = NULL;
|
|
}
|
|
|
|
void test_index_bypath__add_directory(void)
|
|
{
|
|
cl_git_fail_with(GIT_EDIRECTORY, git_index_add_bypath(g_idx, "just_a_dir"));
|
|
}
|