summaryrefslogtreecommitdiff
path: root/include/git2/checkout.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-14 23:29:48 -0800
committerRussell Belfer <rb@github.com>2012-11-14 23:29:48 -0800
commitbbe6dbec81d2050fb52b600bc27e2dacdc780e77 (patch)
tree61f442146ed5b98352016f4ecec3ac4736e10c8c /include/git2/checkout.h
parentbad68c0a998116685ad75cab84210004dd2c5be1 (diff)
downloadlibgit2-bbe6dbec81d2050fb52b600bc27e2dacdc780e77.tar.gz
Add explicit git_index ptr to diff and checkout
A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
Diffstat (limited to 'include/git2/checkout.h')
-rw-r--r--include/git2/checkout.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h
index d444450f3..27ecc7102 100644
--- a/include/git2/checkout.h
+++ b/include/git2/checkout.h
@@ -199,13 +199,15 @@ GIT_EXTERN(int) git_checkout_head(
/**
* Updates files in the working tree to match the content of the index.
*
- * @param repo repository to check out (must be non-bare)
+ * @param repo repository into which to check out (must be non-bare)
+ * @param index index to be checked out (or NULL to use repository index)
* @param opts specifies checkout options (may be NULL)
* @return 0 on success, GIT_ERROR otherwise (use giterr_last for information
* about the error)
*/
GIT_EXTERN(int) git_checkout_index(
git_repository *repo,
+ git_index *index,
git_checkout_opts *opts);
/**