diff options
author | Vicent Marti <vicent@github.com> | 2014-04-09 12:09:30 +0200 |
---|---|---|
committer | Vicent Marti <vicent@github.com> | 2014-04-09 12:09:30 +0200 |
commit | 361e919280b848991108794ce6bb329d93eef676 (patch) | |
tree | 0bdca8f0e030b3d4ffe1c40ea87184107302504f /src/diff.c | |
parent | 3ed8d00cc87f671ab060b985e7597efbb5de8c91 (diff) | |
parent | eb7e17cc900f1f59f653cd7b277750fb1d5b721a (diff) | |
download | libgit2-361e919280b848991108794ce6bb329d93eef676.tar.gz |
Merge pull request #2257 from libgit2/rb/fix-submodules-with-tracked-content
Update treatment of submodule-like directories with tracked content in the parent
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c index 484273f4a..e62f45c22 100644 --- a/src/diff.c +++ b/src/diff.c @@ -876,7 +876,7 @@ static int handle_unmatched_new_item( DIFF_FLAG_IS_SET(diff, GIT_DIFF_RECURSE_IGNORED_DIRS)); /* do not advance into directories that contain a .git file */ - if (recurse_into_dir) { + if (recurse_into_dir && !contains_oitem) { git_buf *full = NULL; if (git_iterator_current_workdir_path(&full, info->new_iter) < 0) return -1; @@ -969,6 +969,16 @@ static int handle_unmatched_new_item( if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) { giterr_clear(); delta_type = GIT_DELTA_IGNORED; + + /* if this contains a tracked item, treat as normal TREE */ + if (contains_oitem) { + error = git_iterator_advance_into(&info->nitem, info->new_iter); + if (error != GIT_ENOTFOUND) + return error; + + giterr_clear(); + return git_iterator_advance(&info->nitem, info->new_iter); + } } } |