Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-05-21 01:22:17 +0300
committerEdward Thomson <ethomson@edwardthomson.com>2015-05-21 03:05:55 +0300
commitfa9a969d80a44a1f6d4ef733be0223b94db1b213 (patch)
tree404b8526a7236f9fda2264c278cfadde5ff023d0 /tests/index
parentcd3f3c2844715b12583eb4d4a6129d3050f115a4 (diff)
index_add_all: include untracked files in new subdirs
Diffstat (limited to 'tests/index')
-rw-r--r--tests/index/addall.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/index/addall.c b/tests/index/addall.c
index f13b768ce..377d2079e 100644
--- a/tests/index/addall.c
+++ b/tests/index/addall.c
@@ -282,6 +282,29 @@ void test_index_addall__repo_lifecycle(void)
git_index_free(index);
}
+void test_index_addall__files_in_folders(void)
+{
+ git_index *index;
+ git_strarray paths = { NULL, 0 };
+
+ addall_create_test_repo(true);
+
+ cl_git_pass(git_repository_index(&index, g_repo));
+
+ cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL));
+ check_stat_data(index, TEST_DIR "/file.bar", true);
+ check_status(g_repo, 2, 0, 0, 0, 0, 0, 1);
+
+ cl_must_pass(p_mkdir(TEST_DIR "/subdir", 0777));
+ cl_git_mkfile(TEST_DIR "/subdir/file", "hello!\n");
+ check_status(g_repo, 2, 0, 0, 1, 0, 0, 1);
+
+ cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL));
+ check_status(g_repo, 3, 0, 0, 0, 0, 0, 1);
+
+ git_index_free(index);
+}
+
static int addall_match_prefix(
const char *path, const char *matched_pathspec, void *payload)
{