diff options
author | Vicent Martà <vicent@github.com> | 2013-03-19 11:47:23 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-03-19 11:47:23 -0700 |
commit | 7dbf4039ae0881407fc9ead24c09c1d7cfd4103a (patch) | |
tree | 25e24ee5bcb31f8845a18eece7255b450fe04af2 /src/diff.c | |
parent | 0b0ecbec2b576400980b22cf2c8fb4d9ab76c423 (diff) | |
parent | 65025cb8934a289460bc64f82c27027c68a85be6 (diff) | |
download | libgit2-7dbf4039ae0881407fc9ead24c09c1d7cfd4103a.tar.gz |
Merge pull request #1423 from arrbee/submodule-status-errors
Three submodule status bug fixes
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/diff.c b/src/diff.c index fc37d139d..fb69f8920 100644 --- a/src/diff.c +++ b/src/diff.c @@ -512,13 +512,17 @@ static int maybe_modified( status = GIT_DELTA_UNMODIFIED; else if (S_ISGITLINK(nmode)) { + int err; git_submodule *sub; if ((diff->opts.flags & GIT_DIFF_IGNORE_SUBMODULES) != 0) status = GIT_DELTA_UNMODIFIED; - else if (git_submodule_lookup(&sub, diff->repo, nitem->path) < 0) - return -1; - else if (git_submodule_ignore(sub) == GIT_SUBMODULE_IGNORE_ALL) + else if ((err = git_submodule_lookup(&sub, diff->repo, nitem->path)) < 0) { + if (err == GIT_EEXISTS) + status = GIT_DELTA_UNMODIFIED; + else + return err; + } else if (git_submodule_ignore(sub) == GIT_SUBMODULE_IGNORE_ALL) status = GIT_DELTA_UNMODIFIED; else { unsigned int sm_status = 0; |