diff options
Diffstat (limited to 'builtin/sparse-checkout.c')
| -rw-r--r-- | builtin/sparse-checkout.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 314c8d61f8..f2356554e5 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -186,6 +186,8 @@ static void clean_tracked_sparse_directories(struct repository *r) item->string); } + strvec_clear(&s); + clear_pathspec(&p); dir_clear(&dir); } @@ -469,6 +471,9 @@ static int sparse_checkout_init(int argc, const char **argv) FILE *fp; /* assume we are in a fresh repo, but update the sparse-checkout file */ + if (safe_create_leading_directories(sparse_filename)) + die(_("unable to create leading directories of %s"), + sparse_filename); fp = xfopen(sparse_filename, "w"); if (!fp) die(_("failed to open '%s'"), sparse_filename); |
