summaryrefslogtreecommitdiff
path: root/src/reset.c
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 /src/reset.c
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 'src/reset.c')
-rw-r--r--src/reset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reset.c b/src/reset.c
index 69a9c4f04..8f470b26a 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -139,7 +139,7 @@ int git_reset(
memset(&opts, 0, sizeof(opts));
opts.checkout_strategy = GIT_CHECKOUT_FORCE;
- if (git_checkout_index(repo, &opts) < 0) {
+ if (git_checkout_index(repo, NULL, &opts) < 0) {
giterr_set(GITERR_INDEX, "%s - Failed to checkout the index.", ERROR_MSG);
goto cleanup;
}