diff options
author | Russell Belfer <rb@github.com> | 2012-10-05 15:56:57 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-10-09 11:59:34 -0700 |
commit | 0d64bef941928046d114c4da1acb70bd2907855e (patch) | |
tree | 4ae0ac6484c62b0a63ca44f937d67ba15f97d7f0 /include/git2/checkout.h | |
parent | f3a04e0f49d0f46e578613d1c27161abc4c2bf22 (diff) | |
download | libgit2-0d64bef941928046d114c4da1acb70bd2907855e.tar.gz |
Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the
"typechanges" test repository, but that revealed numerous issues
with checkout, including:
* complete failure with submodules
* failure to create blobs with exec bits
* problems when replacing a tree with a blob because the tree
"example/" sorts after the blob "example" so the delete was
being processed after the single file blob was created
This fixes most of those problems and includes a number of other
minor changes that made it easier to do that, including improving
the TYPECHANGE support in diff/status, etc.
Diffstat (limited to 'include/git2/checkout.h')
-rw-r--r-- | include/git2/checkout.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h index ef3badbe9..fb1a23030 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -21,12 +21,27 @@ */ GIT_BEGIN_DECL -enum { +/** + * Checkout behavior flags + * + * These flags control what checkout does with files. Pass in a + * combination of these values OR'ed together. + * + * - GIT_CHECKOUT_DEFAULT: With this value, checkout does not update + * any files in the working directory. + * - GIT_CHECKOUT_OVERWRITE_MODIFIED: When a file exists and is modified, + * replace the modifications with the new version. + * - GIT_CHECKOUT_CREATE_MISSING: When a file does not exist in the + * working directory, create it. + * - GIT_CHECKOUT_REMOVE_UNTRACKED: If an untracked file in encountered + * in the working directory, delete it. + */ +typedef enum { GIT_CHECKOUT_DEFAULT = (1 << 0), GIT_CHECKOUT_OVERWRITE_MODIFIED = (1 << 1), GIT_CHECKOUT_CREATE_MISSING = (1 << 2), GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 3), -}; +} git_checkout_strategy_t; /* Use zeros to indicate default settings */ typedef struct git_checkout_opts { |