diff options
author | Russell Belfer <rb@github.com> | 2013-06-17 10:46:15 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-17 10:46:15 -0700 |
commit | c09810eedfd89923e5bda25d0c98def292dee732 (patch) | |
tree | 668d7196ff3b01c553bbe0c5dd5712e861b6cfc6 /src/diff_patch.c | |
parent | 09c2f91c150a4862c9189d9e08d0dc111d4d706c (diff) | |
parent | f4183347607c85d3fbe02e8591d9393a011ecdf2 (diff) | |
download | libgit2-c09810eedfd89923e5bda25d0c98def292dee732.tar.gz |
Merge pull request #1651 from arrbee/status_indexed_updates
Status indexed updates
Diffstat (limited to 'src/diff_patch.c')
-rw-r--r-- | src/diff_patch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/diff_patch.c b/src/diff_patch.c index a1e1fe84c..40cb3371a 100644 --- a/src/diff_patch.c +++ b/src/diff_patch.c @@ -175,10 +175,11 @@ static int diff_patch_load(git_diff_patch *patch, git_diff_output *output) goto cleanup; } - /* if we were previously missing an oid, reassess UNMODIFIED state */ + /* if we were previously missing an oid, update MODIFIED->UNMODIFIED */ if (incomplete_data && patch->ofile.file.mode == patch->nfile.file.mode && - git_oid_equal(&patch->ofile.file.oid, &patch->nfile.file.oid)) + git_oid_equal(&patch->ofile.file.oid, &patch->nfile.file.oid) && + patch->delta->status == GIT_DELTA_MODIFIED) /* not RENAMED/COPIED! */ patch->delta->status = GIT_DELTA_UNMODIFIED; cleanup: @@ -284,6 +285,7 @@ int git_diff_foreach( git_xdiff_init(&xo, &diff->opts); git_vector_foreach(&diff->deltas, idx, patch.delta) { + /* check flags against patch status */ if (git_diff_delta__should_skip(&diff->opts, patch.delta)) continue; |