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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/dir.c b/dir.c
index 20b942d161..0efa67fbec 100644
--- a/dir.c
+++ b/dir.c
@@ -53,12 +53,6 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
int check_only, int stop_at_first_file, const struct pathspec *pathspec);
static int resolve_dtype(int dtype, struct index_state *istate,
const char *path, int len);
-
-void dir_init(struct dir_struct *dir)
-{
- memset(dir, 0, sizeof(*dir));
-}
-
struct dirent *readdir_skip_dot_and_dotdot(DIR *dirp)
{
struct dirent *e;
@@ -3115,6 +3109,7 @@ void dir_clear(struct dir_struct *dir)
struct exclude_list_group *group;
struct pattern_list *pl;
struct exclude_stack *stk;
+ struct dir_struct new = DIR_INIT;
for (i = EXC_CMDL; i <= EXC_FILE; i++) {
group = &dir->exclude_list_group[i];
@@ -3142,7 +3137,7 @@ void dir_clear(struct dir_struct *dir)
}
strbuf_release(&dir->basebuf);
- dir_init(dir);
+ memcpy(dir, &new, sizeof(*dir));
}
struct ondisk_untracked_cache {