summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-04-20 20:05:23 -0400
committerEdward Thomson <ethomson@microsoft.com>2015-05-11 14:12:31 -0400
commit12149a20ef7cfb67563c639f2583bce0cadb4df9 (patch)
tree5c3c060c4bece603c80efca52d47996d478588c1 /src
parentf78bb2afb3a7f23264c4adf2e9debfa415ca8107 (diff)
downloadlibgit2-12149a20ef7cfb67563c639f2583bce0cadb4df9.tar.gz
stash apply: default to at least GIT_CHECKOUT_SAFE
Diffstat (limited to 'src')
-rw-r--r--src/stash.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stash.c b/src/stash.c
index e3e025771..3f60ee017 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -681,11 +681,12 @@ static void normalize_checkout_options(
memcpy(checkout_opts, given_checkout_opts, sizeof(git_checkout_options));
} else {
git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
- default_checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
-
memcpy(checkout_opts, &default_checkout_opts, sizeof(git_checkout_options));
}
+ if ((checkout_opts->checkout_strategy & (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_FORCE)) == 0)
+ checkout_opts->checkout_strategy = GIT_CHECKOUT_SAFE;
+
if (!checkout_opts->our_label)
checkout_opts->our_label = "Updated upstream";