diff options
| author | Russell Belfer <rb@github.com> | 2013-12-02 13:30:05 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-12-02 13:30:05 -0800 |
| commit | 97ad85b88d7a2f6d1c31a07de3c3c0b4b504d4ee (patch) | |
| tree | 969ed56c8410d3f5f30145b3ce16335cb356075a /src | |
| parent | 2123a17f83cc95adee4e7259d0686b07f074de4c (diff) | |
| download | libgit2-97ad85b88d7a2f6d1c31a07de3c3c0b4b504d4ee.tar.gz | |
Add GIT_DIFF_FIND_DELETE_UNMODIFIED flag
When doing copy detection, it is often necessary to include
UNMODIFIED records in the git_diff so they are available as source
records for GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED. Yet in the final
diff, often you will not want to have these UNMODIFIED records.
This adds a flag which marks these UNMODIFIED records for deletion
from the diff list so they will be removed after the rename detect
phase is over.
Diffstat (limited to 'src')
| -rw-r--r-- | src/diff_tform.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c index 3b5575d28..bff821dc3 100644 --- a/src/diff_tform.c +++ b/src/diff_tform.c @@ -746,6 +746,8 @@ static bool is_rename_source( case GIT_DELTA_UNMODIFIED: if (!FLAG_SET(opts, GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED)) return false; + if (FLAG_SET(opts, GIT_DIFF_FIND_DELETE_UNMODIFIED)) + delta->flags |= GIT_DIFF_FLAG__TO_DELETE; break; default: /* MODIFIED, RENAMED, COPIED */ |
