summaryrefslogtreecommitdiff
path: root/src/status.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/status.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/status.c')
-rw-r--r--src/status.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/status.c b/src/status.c
index 9140ac2a8..b8c15ef92 100644
--- a/src/status.c
+++ b/src/status.c
@@ -142,11 +142,11 @@ int git_status_foreach_ext(
/* TODO: support EXCLUDE_SUBMODULES flag */
if (show != GIT_STATUS_SHOW_WORKDIR_ONLY &&
- (err = git_diff_index_to_tree(&idx2head, repo, head, &diffopt)) < 0)
+ (err = git_diff_index_to_tree(&idx2head, repo, head, NULL, &diffopt)) < 0)
goto cleanup;
if (show != GIT_STATUS_SHOW_INDEX_ONLY &&
- (err = git_diff_workdir_to_index(&wd2idx, repo, &diffopt)) < 0)
+ (err = git_diff_workdir_to_index(&wd2idx, repo, NULL, &diffopt)) < 0)
goto cleanup;
usercb.cb = cb;