diff options
author | Russell Belfer <rb@github.com> | 2013-04-27 02:35:47 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-04-30 15:25:56 +0400 |
commit | e26b14c0345ef82771f222aa50be926f5969531d (patch) | |
tree | 2471b9eaba32bd46589d778e6d6a5dfbeb9b7d03 /src/vector.c | |
parent | fdb3034e725ccf2c7be11871fcc374ced436983e (diff) |
Update diff handling of untracked directories
When diff encounters an untracked directory, there was a shortcut
that it took which is not compatible with core git. This makes
the default behavior no longer take that shortcut and instead look
inside the untracked directory to see if there are any untracked
files within it. If there are not, then the directory is treated
as an ignore directory instead of an untracked directory. This
has implications for the git_status APIs.
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vector.c b/src/vector.c index f4a818ed2..5ba2fab18 100644 --- a/src/vector.c +++ b/src/vector.c @@ -277,15 +277,13 @@ void git_vector_swap(git_vector *a, git_vector *b) int git_vector_resize_to(git_vector *v, size_t new_length) { - if (new_length <= v->length) - return 0; - if (new_length > v->_alloc_size && resize_vector(v, new_length) < 0) return -1; - memset(&v->contents[v->length], 0, - sizeof(void *) * (new_length - v->length)); + if (new_length > v->length) + memset(&v->contents[v->length], 0, + sizeof(void *) * (new_length - v->length)); v->length = new_length; |