summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-07-03 12:20:34 -0700
committerRussell Belfer <rb@github.com>2013-07-03 12:20:34 -0700
commit2a16914c35fe52785959647666da145be354b12f (patch)
tree3a74a0c5189b9bacd5be60e0fbf433f589ac1eb3 /src
parent4ae29053d51968cbf49f30ae14e5405cbd9543cc (diff)
downloadlibgit2-2a16914c35fe52785959647666da145be354b12f.tar.gz
Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR option
This option serves no benefit now that the git_status_list API is available. It was of questionable value before and now it would just be a bad idea to use it rather than the indexed API.
Diffstat (limited to 'src')
-rw-r--r--src/diff.c2
-rw-r--r--src/status.c17
2 files changed, 5 insertions, 14 deletions
diff --git a/src/diff.c b/src/diff.c
index 9e9528ef9..0980f412a 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1249,6 +1249,8 @@ int git_diff__paired_foreach(
i_max = head2idx ? head2idx->deltas.length : 0;
j_max = idx2wd ? idx2wd->deltas.length : 0;
+ if (!i_max && !j_max)
+ return 0;
/* At some point, tree-to-index diffs will probably never ignore case,
* even if that isn't true now. Index-to-workdir diffs may or may not
diff --git a/src/status.c b/src/status.c
index 7da94edc1..ccb8d37da 100644
--- a/src/status.c
+++ b/src/status.c
@@ -257,9 +257,8 @@ int git_status_list_new(
opts ? opts->show : GIT_STATUS_SHOW_INDEX_AND_WORKDIR;
int error = 0;
unsigned int flags = opts ? opts->flags : GIT_STATUS_OPT_DEFAULTS;
- git_diff_list *head2idx = NULL;
- assert(show <= GIT_STATUS_SHOW_INDEX_THEN_WORKDIR);
+ assert(show <= GIT_STATUS_SHOW_WORKDIR_ONLY);
*out = NULL;
@@ -308,10 +307,8 @@ int git_status_list_new(
&status->head2idx, repo, head, NULL, &diffopt)) < 0)
goto done;
- head2idx = status->head2idx;
-
if ((flags & GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX) != 0 &&
- (error = git_diff_find_similar(head2idx, NULL)) < 0)
+ (error = git_diff_find_similar(status->head2idx, NULL)) < 0)
goto done;
}
@@ -325,16 +322,8 @@ int git_status_list_new(
goto done;
}
- if (show == GIT_STATUS_SHOW_INDEX_THEN_WORKDIR) {
- if ((error = git_diff__paired_foreach(
- head2idx, NULL, status_collect, status)) < 0)
- goto done;
-
- head2idx = NULL;
- }
-
if ((error = git_diff__paired_foreach(
- head2idx, status->idx2wd, status_collect, status)) < 0)
+ status->head2idx, status->idx2wd, status_collect, status)) < 0)
goto done;
if (flags & GIT_STATUS_OPT_SORT_CASE_SENSITIVELY)