Remove `clone_checkout_strategy` in submodule update opts Remove `clone_checkout_strategy` in `git_submodule_update_options` as per issue #3784.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dae86de..1c5644b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -61,6 +61,10 @@ v0.24 + 1
* `git_blob_create_fromchunks()` has been removed in favour of
`git_blob_create_fromstream()`.
+* `clone_checkout_strategy` has been removed from
+ `git_submodule_update_option` as it is no longer necessary after
+ removing the `GIT_CHECKOUT_SAFE_CREATE` flag in favour of the 'GIT_CHECKOUT_SAFE' flag.
+
### Breaking API changes
* `git_packbuilder_object_count` and `git_packbuilder_written` now
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index 540ecf5..ab5d7b6 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -134,9 +134,7 @@ typedef struct git_submodule_update_options {
* checkout, set the `checkout_strategy` to
* `GIT_CHECKOUT_NONE`. Generally you will want the use
* GIT_CHECKOUT_SAFE to update files in the working
- * directory. Use the `clone_checkout_strategy` field
- * to set the checkout strategy that will be used in
- * the case where update needs to clone the repository.
+ * directory.
*/
git_checkout_options checkout_opts;
@@ -149,13 +147,6 @@ typedef struct git_submodule_update_options {
git_fetch_options fetch_opts;
/**
- * The checkout strategy to use when the sub repository needs to
- * be cloned. Use GIT_CHECKOUT_SAFE to create all files
- * in the working directory for the newly cloned repository.
- */
- unsigned int clone_checkout_strategy;
-
- /**
* Allow fetching from the submodule's default remote if the target
* commit isn't found. Enabled by default.
*/
@@ -166,7 +157,7 @@ typedef struct git_submodule_update_options {
#define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \
{ GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \
{ GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
- GIT_FETCH_OPTIONS_INIT, GIT_CHECKOUT_SAFE, 1 }
+ GIT_FETCH_OPTIONS_INIT, GIT_CHECKOUT_SAFE }
/**
* Initializes a `git_submodule_update_options` with default values.
diff --git a/src/submodule.c b/src/submodule.c
index 86ad53b..0175ac5 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1160,7 +1160,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
* will checkout the specific commit manually.
*/
clone_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE;
- update_options.checkout_opts.checkout_strategy = update_options.clone_checkout_strategy;
+ update_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options)) < 0 ||
(error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm))) < 0 ||