mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 09:54:37 +00:00
Remove clone_checkout_strategy
in submodule update opts
Remove `clone_checkout_strategy` in `git_submodule_update_options` as per issue #3784.
This commit is contained in:
parent
610cff13a3
commit
567fd782d9
@ -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 {
|
|||||||
* 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;
|
||||||
|
|
||||||
@ -148,13 +146,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 {
|
|||||||
#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
|
|||||||
* 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 ||
|
||||||
|
Loading…
Reference in New Issue
Block a user