diff options
author | Vicent Martà <vicent@github.com> | 2013-05-15 15:47:46 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-05-15 15:47:46 -0700 |
commit | 71596200443cdefb374750a1922dc9e1d0be7d53 (patch) | |
tree | ef793279cec76aae5b7a4c0aa0d36d770ac2fc1a /src/diff.c | |
parent | 6957f73cc1d484dd6514596e73255e635db60f0f (diff) | |
parent | 72b3dd4a5ca2f6572e741c243cd973963d0ef419 (diff) | |
download | libgit2-71596200443cdefb374750a1922dc9e1d0be7d53.tar.gz |
Merge pull request #1588 from arrbee/fixes-for-checkout-and-diff
Bug fixes for checkout and diff
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index f466546bb..d93506984 100644 --- a/src/diff.c +++ b/src/diff.c @@ -747,7 +747,8 @@ static int diff_scan_inside_untracked_dir( } /* look for actual untracked file */ - while (!diff->pfxcomp(info->nitem->path, git_buf_cstr(&base))) { + while (info->nitem != NULL && + !diff->pfxcomp(info->nitem->path, git_buf_cstr(&base))) { is_ignored = git_iterator_current_is_ignored(info->new_iter); /* need to recurse into non-ignored directories */ @@ -769,7 +770,8 @@ static int diff_scan_inside_untracked_dir( } /* finish off scan */ - while (!diff->pfxcomp(info->nitem->path, git_buf_cstr(&base))) { + while (info->nitem != NULL && + !diff->pfxcomp(info->nitem->path, git_buf_cstr(&base))) { if ((error = git_iterator_advance(&info->nitem, info->new_iter)) < 0) break; } |