diff options
| author | Russell Belfer <rb@github.com> | 2014-04-23 16:28:45 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2014-04-23 16:28:45 -0700 |
| commit | 219c89d19d7e18a336faa094b0c29cb7bb0d22c6 (patch) | |
| tree | 7b92ff71719817db7dfce3378b5b90b2170f7e80 /src/checkout.c | |
| parent | 37da368545b28157e625212e8009ec041cc4a4ea (diff) | |
| download | libgit2-219c89d19d7e18a336faa094b0c29cb7bb0d22c6.tar.gz | |
Treat ignored, empty, and untracked dirs different
In the iterator, distinguish between ignores and empty directories
so that diff and status can ignore empty directories, but checkout
and stash can treat them as untracked items.
Diffstat (limited to 'src/checkout.c')
| -rw-r--r-- | src/checkout.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/checkout.c b/src/checkout.c index a412c4c4e..bc976b854 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -336,22 +336,22 @@ static int checkout_action_wd_only( error = git_iterator_advance(wditem, workdir); } else { /* untracked or ignored - can't know which until we advance through */ - bool ignored, over = false; - bool removable = wd_item_is_removable(workdir, wd); + bool over = false, removable = wd_item_is_removable(workdir, wd); + git_iterator_status_t untracked_state; /* copy the entry for issuing notification callback later */ git_index_entry saved_wd = *wd; git_buf_sets(&data->tmp, wd->path); saved_wd.path = data->tmp.ptr; - error = git_iterator_advance_over_and_check_ignored( - wditem, &ignored, workdir); + error = git_iterator_advance_over_with_status( + wditem, &untracked_state, workdir); if (error == GIT_ITEROVER) over = true; else if (error < 0) return error; - if (ignored) { + if (untracked_state == GIT_ITERATOR_STATUS_IGNORED) { notify = GIT_CHECKOUT_NOTIFY_IGNORED; remove = ((data->strategy & GIT_CHECKOUT_REMOVE_IGNORED) != 0); } else { |
