summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Huber <steffhip@gmail.com>2016-08-24 01:20:39 +0200
committerPatrick Steinhardt <ps@pks.im>2016-08-30 08:04:28 +0200
commit88cfe61497dbf1f568e1c606f8b1c791602c71f4 (patch)
treef98363732485f5a3abe33debef803880f2762b53 /src
parentdfd7957696eed03733d8edb17e132153c7dc7a4e (diff)
downloadlibgit2-88cfe61497dbf1f568e1c606f8b1c791602c71f4.tar.gz
git_checkout_tree options fix
According to the reference the git_checkout_tree and git_checkout_head functions should accept NULL in the opts field This was broken since the opts field was dereferenced and thus lead to a crash.
Diffstat (limited to 'src')
-rw-r--r--src/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 72ee8b624..f11102c8b 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -2722,7 +2722,7 @@ int git_checkout_tree(
if ((error = git_repository_index(&index, repo)) < 0)
return error;
- if ((opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) {
+ if (opts && (opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) {
iter_opts.pathlist.count = opts->paths.count;
iter_opts.pathlist.strings = opts->paths.strings;
}