summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-03-04 22:40:13 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2021-03-04 22:40:13 +0800
commit4dd8469336cc06923acceb3ea4ae02ea00461c5d (patch)
tree92aa9b355242c8904510bb9b61ddfa94b4d1ee47 /dir.c
parentl10n: tr: v2.31.0-rc0 (diff)
parentGit 2.31-rc1 (diff)
downloadtgif-4dd8469336cc06923acceb3ea4ae02ea00461c5d.tar.xz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (63 commits) Git 2.31-rc1 Hopefully the last batch before -rc1 Revert "commit-graph: when incompatible with graphs, indicate why" read-cache: make the index write buffer size 128K dir: fix malloc of root untracked_cache_dir commit-graph.c: display correct number of chunks when writing doc/reftable: document how to handle windows fetch-pack: print and use dangling .gitmodules fetch-pack: with packfile URIs, use index-pack arg http-fetch: allow custom index-pack args http: allow custom index-pack args chunk-format: add technical docs chunk-format: restore duplicate chunk checks midx: use 64-bit multiplication for chunk sizes midx: use chunk-format read API commit-graph: use chunk-format read API chunk-format: create read chunk API midx: use chunk-format API in write_midx_internal() midx: drop chunk progress during write midx: return success/failure in chunk write methods ...
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/dir.c b/dir.c
index d153a63bbd..fd8aa7c40f 100644
--- a/dir.c
+++ b/dir.c
@@ -2730,11 +2730,8 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
return NULL;
}
- if (!dir->untracked->root) {
- const int len = sizeof(*dir->untracked->root);
- dir->untracked->root = xmalloc(len);
- memset(dir->untracked->root, 0, len);
- }
+ if (!dir->untracked->root)
+ FLEX_ALLOC_STR(dir->untracked->root, name, "");
/* Validate $GIT_DIR/info/exclude and core.excludesfile */
root = dir->untracked->root;