summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-23 10:15:51 +0100
committerPatrick Steinhardt <ps@pks.im>2020-06-01 14:12:17 +0200
commit0f35efeb5722f950218e3649d7814a6a91b1c351 (patch)
treee53af9e934365660d0bacfd4c24b40434dfd353f /src/checkout.c
parentabfdb8a6d252a4834df9234ad338c97f1a4f97f2 (diff)
downloadlibgit2-ethomson/poolinit.tar.gz
git_pool_init: handle failure casesethomson/poolinit
Propagate failures caused by pool initialization errors.
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 272bd3789..1e6ea4ddf 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1310,7 +1310,8 @@ static int checkout_get_actions(
size_t i, *counts = NULL;
uint32_t *actions = NULL;
- git_pool_init(&pathpool, 1);
+ if (git_pool_init(&pathpool, 1) < 0)
+ return -1;
if (data->opts.paths.count > 0 &&
git_pathspec__vinit(&pathspec, &data->opts.paths, &pathpool) < 0)
@@ -2526,9 +2527,8 @@ static int checkout_data_init(
git_config_entry_free(conflict_style);
}
- git_pool_init(&data->pool, 1);
-
- if ((error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 ||
+ if ((error = git_pool_init(&data->pool, 1)) < 0 ||
+ (error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 ||
(error = git_vector_init(&data->remove_conflicts, 0, NULL)) < 0 ||
(error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 ||
(error = git_buf_puts(&data->target_path, data->opts.target_directory)) < 0 ||