Commit 58451759c2fd728149aad6dc91cb0c3e774f68c7

punkymaniac 2021-10-14T09:55:00

Change default checkout strategy from FORCE to SAFE Since we are able to give our own git checkout options, the default git checkout strategy will be the same as initialized in a new git_checkout_options struct.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/worktree.c b/src/worktree.c
index caf4c58..6bf6042 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -407,8 +407,6 @@ int git_worktree_add(git_worktree **out, git_repository *repo,
 	/* Checkout worktree's HEAD */
 	if (opts != NULL)
 		memcpy(&coopts, &wtopts.checkout_opts, sizeof(coopts));
-	else
-		coopts.checkout_strategy = GIT_CHECKOUT_FORCE;
 	if ((err = git_checkout_head(wt, &coopts)) < 0)
 		goto out;