Commit 567fd782 by Josh Leeb-du Toit

Remove `clone_checkout_strategy` in submodule update opts

Remove `clone_checkout_strategy` in `git_submodule_update_options` as
per issue #3784.
parent 610cff13
...@@ -61,6 +61,10 @@ v0.24 + 1 ...@@ -61,6 +61,10 @@ v0.24 + 1
* `git_blob_create_fromchunks()` has been removed in favour of * `git_blob_create_fromchunks()` has been removed in favour of
`git_blob_create_fromstream()`. `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 ### Breaking API changes
* `git_packbuilder_object_count` and `git_packbuilder_written` now * `git_packbuilder_object_count` and `git_packbuilder_written` now
......
...@@ -134,9 +134,7 @@ typedef struct git_submodule_update_options { ...@@ -134,9 +134,7 @@ typedef struct git_submodule_update_options {
* checkout, set the `checkout_strategy` to * checkout, set the `checkout_strategy` to
* `GIT_CHECKOUT_NONE`. Generally you will want the use * `GIT_CHECKOUT_NONE`. Generally you will want the use
* GIT_CHECKOUT_SAFE to update files in the working * GIT_CHECKOUT_SAFE to update files in the working
* directory. Use the `clone_checkout_strategy` field * directory.
* to set the checkout strategy that will be used in
* the case where update needs to clone the repository.
*/ */
git_checkout_options checkout_opts; git_checkout_options checkout_opts;
...@@ -149,13 +147,6 @@ typedef struct git_submodule_update_options { ...@@ -149,13 +147,6 @@ typedef struct git_submodule_update_options {
git_fetch_options fetch_opts; 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 * Allow fetching from the submodule's default remote if the target
* commit isn't found. Enabled by default. * commit isn't found. Enabled by default.
*/ */
...@@ -166,7 +157,7 @@ typedef struct git_submodule_update_options { ...@@ -166,7 +157,7 @@ typedef struct git_submodule_update_options {
#define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \ #define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \
{ GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \ { GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \
{ GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \ { 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. * Initializes a `git_submodule_update_options` with default values.
......
...@@ -1160,7 +1160,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio ...@@ -1160,7 +1160,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
* will checkout the specific commit manually. * will checkout the specific commit manually.
*/ */
clone_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE; 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 || 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 || (error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm))) < 0 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment