summaryrefslogtreecommitdiff
path: root/include/git2/checkout.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-10-17 14:14:51 -0700
committerRussell Belfer <rb@github.com>2012-10-17 14:14:51 -0700
commit4c47a8bcfe03c42096b74d4af06ab95fb95fd211 (patch)
treec79eb8290ef110faff68ae2d5746455095508e1e /include/git2/checkout.h
parent6012e86839bbdfc98085662c22f8e34b6f6abefb (diff)
parent52a61bb8047f431bf363bd9327d0f34884437c83 (diff)
downloadlibgit2-4c47a8bcfe03c42096b74d4af06ab95fb95fd211.tar.gz
Merge pull request #968 from arrbee/diff-support-typechange
Support TYPECHANGE records in status and adjust checkout accordingly
Diffstat (limited to 'include/git2/checkout.h')
-rw-r--r--include/git2/checkout.h45
1 files changed, 31 insertions, 14 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h
index a4d0a0cef..0bac5690a 100644
--- a/include/git2/checkout.h
+++ b/include/git2/checkout.h
@@ -21,22 +21,39 @@
*/
GIT_BEGIN_DECL
-enum {
- GIT_CHECKOUT_DEFAULT = (1 << 0),
- GIT_CHECKOUT_OVERWRITE_MODIFIED = (1 << 1),
- GIT_CHECKOUT_CREATE_MISSING = (1 << 2),
- GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 3),
-};
+/**
+ * Checkout behavior flags
+ *
+ * These flags control what checkout does with files. Pass in a
+ * combination of these values OR'ed together.
+ */
+typedef enum {
+ /** Checkout does not update any files in the working directory. */
+ GIT_CHECKOUT_DEFAULT = (1 << 0),
+
+ /** When a file exists and is modified, replace it with new version. */
+ GIT_CHECKOUT_OVERWRITE_MODIFIED = (1 << 1),
+
+ /** When a file does not exist in the working directory, create it. */
+ GIT_CHECKOUT_CREATE_MISSING = (1 << 2),
-/* Use zeros to indicate default settings */
+ /** If an untracked file in found in the working dir, delete it. */
+ GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 3),
+} git_checkout_strategy_t;
+
+/**
+ * Checkout options structure
+ *
+ * Use zeros to indicate default settings.
+ */
typedef struct git_checkout_opts {
- unsigned int checkout_strategy; /* default: GIT_CHECKOUT_DEFAULT */
- int disable_filters;
- int dir_mode; /* default is 0755 */
- int file_mode; /* default is 0644 */
- int file_open_flags; /* default is O_CREAT | O_TRUNC | O_WRONLY */
+ unsigned int checkout_strategy; /** default: GIT_CHECKOUT_DEFAULT */
+ int disable_filters; /** don't apply filters like CRLF conversion */
+ int dir_mode; /** default is 0755 */
+ int file_mode; /** default is 0644 or 0755 as dictated by blob */
+ int file_open_flags; /** default is O_CREAT | O_TRUNC | O_WRONLY */
- /* Optional callback to notify the consumer of files that
+ /** Optional callback to notify the consumer of files that
* haven't be checked out because a modified version of them
* exist in the working directory.
*
@@ -51,7 +68,7 @@ typedef struct git_checkout_opts {
void *notify_payload;
- /* when not NULL, arrays of fnmatch pattern specifying
+ /** When not NULL, array of fnmatch patterns specifying
* which paths should be taken into account
*/
git_strarray paths;