summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index aa96030031..8d6c59a9dc 100644
--- a/dir.c
+++ b/dir.c
@@ -54,6 +54,11 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
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));
+}
+
int count_slashes(const char *s)
{
int cnt = 0;
@@ -3012,7 +3017,7 @@ int remove_path(const char *name)
* Frees memory within dir which was allocated, and resets fields for further
* use. Does not free dir itself.
*/
-void clear_directory(struct dir_struct *dir)
+void dir_clear(struct dir_struct *dir)
{
int i, j;
struct exclude_list_group *group;
@@ -3045,7 +3050,7 @@ void clear_directory(struct dir_struct *dir)
}
strbuf_release(&dir->basebuf);
- memset(&dir, 0, sizeof(*dir));
+ dir_init(dir);
}
struct ondisk_untracked_cache {