summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-02-14 11:44:05 -0500
committerEdward Thomson <ethomson@microsoft.com>2015-02-27 13:50:44 -0500
commit96b82b11c64ffcf00e0d10b1bad1b6d1fbfc896c (patch)
treebcca5b2ad67134d451cc3e1d9fe2980cb58b68c6 /include
parent14fec0aea3b57bdf29ab7a195061127f8a3edc30 (diff)
downloadlibgit2-96b82b11c64ffcf00e0d10b1bad1b6d1fbfc896c.tar.gz
checkout: remove `GIT_CHECKOUT_SAFE_CREATE` as a strategy
Diffstat (limited to 'include')
-rw-r--r--include/git2/checkout.h27
-rw-r--r--include/git2/clone.h8
-rw-r--r--include/git2/submodule.h6
3 files changed, 17 insertions, 24 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h
index 4fe1340b9..ed39bd3cb 100644
--- a/include/git2/checkout.h
+++ b/include/git2/checkout.h
@@ -31,7 +31,7 @@ GIT_BEGIN_DECL
* check out, the "baseline" tree of what was checked out previously, the
* working directory for actual files, and the index for staged changes.
*
- * You give checkout one of four strategies for update:
+ * You give checkout one of three strategies for update:
*
* - `GIT_CHECKOUT_NONE` is a dry-run strategy that checks for conflicts,
* etc., but doesn't make any actual changes.
@@ -40,8 +40,8 @@ GIT_BEGIN_DECL
* make the working directory match the target (including potentially
* discarding modified files).
*
- * In between those are `GIT_CHECKOUT_SAFE` and `GIT_CHECKOUT_SAFE_CREATE`
- * both of which only make modifications that will not lose changes.
+ * - `GIT_CHECKOUT_SAFE` is between these two options, it will only make
+ * modifications that will not lose changes.
*
* | target == baseline | target != baseline |
* ---------------------|-----------------------|----------------------|
@@ -51,28 +51,21 @@ GIT_BEGIN_DECL
* workdir exists and | no action | conflict (notify |
* is != baseline | notify dirty MODIFIED | and cancel checkout) |
* ---------------------|-----------------------|----------------------|
- * workdir missing, | create if SAFE_CREATE | create file |
- * baseline present | notify dirty DELETED | |
+ * workdir missing, | notify dirty DELETED | create file |
+ * baseline present | | |
* ---------------------|-----------------------|----------------------|
*
- * The only difference between SAFE and SAFE_CREATE is that SAFE_CREATE
- * will cause a file to be checked out if it is missing from the working
- * directory even if it is not modified between the target and baseline.
- *
- *
* To emulate `git checkout`, use `GIT_CHECKOUT_SAFE` with a checkout
* notification callback (see below) that displays information about dirty
* files. The default behavior will cancel checkout on conflicts.
*
- * To emulate `git checkout-index`, use `GIT_CHECKOUT_SAFE_CREATE` with a
+ * To emulate `git checkout-index`, use `GIT_CHECKOUT_SAFE` with a
* notification callback that cancels the operation if a dirty-but-existing
* file is found in the working directory. This core git command isn't
* quite "force" but is sensitive about some types of changes.
*
* To emulate `git checkout -f`, use `GIT_CHECKOUT_FORCE`.
*
- * To emulate `git clone` use `GIT_CHECKOUT_SAFE_CREATE` in the options.
- *
*
* There are some additional flags to modified the behavior of checkout:
*
@@ -116,12 +109,12 @@ typedef enum {
/** Allow safe updates that cannot overwrite uncommitted data */
GIT_CHECKOUT_SAFE = (1u << 0),
- /** Allow safe updates plus creation of missing files */
- GIT_CHECKOUT_SAFE_CREATE = (1u << 1),
-
/** Allow all updates to force working directory to look like index */
- GIT_CHECKOUT_FORCE = (1u << 2),
+ GIT_CHECKOUT_FORCE = (1u << 1),
+
+ /** Allow checkout to recreate missing files */
+ GIT_CHECKOUT_RECREATE_MISSING = (1u << 2),
/** Allow checkout to make safe updates even if conflicts are found */
GIT_CHECKOUT_ALLOW_CONFLICTS = (1u << 4),
diff --git a/include/git2/clone.h b/include/git2/clone.h
index 464408534..1cee516a1 100644
--- a/include/git2/clone.h
+++ b/include/git2/clone.h
@@ -106,9 +106,7 @@ typedef struct git_clone_options {
/**
* These options are passed to the checkout step. To disable
* checkout, set the `checkout_strategy` to
- * `GIT_CHECKOUT_NONE`. Generally you will want the use
- * GIT_CHECKOUT_SAFE_CREATE to create all files in the working
- * directory for the newly cloned repository.
+ * `GIT_CHECKOUT_NONE`.
*/
git_checkout_options checkout_opts;
@@ -173,7 +171,9 @@ typedef struct git_clone_options {
} git_clone_options;
#define GIT_CLONE_OPTIONS_VERSION 1
-#define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE_CREATE}, GIT_REMOTE_CALLBACKS_INIT}
+#define GIT_CLONE_OPTIONS_INIT { GIT_CLONE_OPTIONS_VERSION, \
+ { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
+ GIT_REMOTE_CALLBACKS_INIT }
/**
* Initializes a `git_clone_options` with default values. Equivalent to
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index f03ea2da8..1c139d0a7 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -137,7 +137,7 @@ typedef struct git_submodule_update_options {
/**
* The checkout strategy to use when the sub repository needs to
- * be cloned. Use GIT_CHECKOUT_SAFE_CREATE to create all files
+ * be cloned. Use GIT_CHECKOUT_SAFE to create all files
* in the working directory for the newly cloned repository.
*/
unsigned int clone_checkout_strategy;
@@ -152,8 +152,8 @@ typedef struct git_submodule_update_options {
#define GIT_SUBMODULE_UPDATE_OPTIONS_VERSION 1
#define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \
{ GIT_CHECKOUT_OPTIONS_VERSION, \
- { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}, \
- GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE_CREATE }
+ { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
+ GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE }
/**
* Initializes a `git_submodule_update_options` with default values.