Skip to content

Commit 675251d

Browse files
authored
Merge pull request libgit2#5032 from eaigner/checkout-force-safe-docfix
docs: clarify relation of safe and forced checkout strategy
2 parents 7f1ba19 + bbba480 commit 675251d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

include/git2/checkout.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,22 @@ GIT_BEGIN_DECL
106106
typedef enum {
107107
GIT_CHECKOUT_NONE = 0, /**< default is a dry run, no actual updates */
108108

109-
/** Allow safe updates that cannot overwrite uncommitted data */
109+
/**
110+
* Allow safe updates that cannot overwrite uncommitted data.
111+
* If the uncommitted changes don't conflict with the checked out files,
112+
* the checkout will still proceed, leaving the changes intact.
113+
*
114+
* Mutually exclusive with GIT_CHECKOUT_FORCE.
115+
* GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.
116+
*/
110117
GIT_CHECKOUT_SAFE = (1u << 0),
111118

112-
/** Allow all updates to force working directory to look like index */
119+
/**
120+
* Allow all updates to force working directory to look like index.
121+
*
122+
* Mutually exclusive with GIT_CHECKOUT_SAFE.
123+
* GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.
124+
*/
113125
GIT_CHECKOUT_FORCE = (1u << 1),
114126

115127

0 commit comments

Comments
 (0)