diff options
author | Russell Belfer <rb@github.com> | 2012-10-24 03:40:51 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-10-24 03:40:51 +0400 |
commit | b4f5bb074721823cc016b66a9984abe2c271cb1f (patch) | |
tree | 946a7522e701442786cdec870a9035f4bde097a4 /src/diff.h | |
parent | 5b67d145d8f465ed0c7ed9c07d331aae29c2713b (diff) |
Initial implementation of diff rename detection
This implements the basis for diff rename and copy detection,
although it is based on simple SHA comparison right now instead
of using a matching algortihm. Just as `git_diff_merge` can be
used as a post-pass on diffs to emulate certain command line
behaviors, there is a new API `git_diff_detect` which will
update a diff list in-place, adjusting some deltas to RENAMED
or COPIED state (and also, eventually, splitting MODIFIED deltas
where the change is too large into DELETED/ADDED pairs).
This also adds a new test repo that will hold rename/copy/split
scenarios. Right now, it just has exact-match rename and copy,
but the tests are written to use tree diffs, so we should be able
to add new test scenarios easily without breaking tests.
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h index c6a26aee7..61723bc9e 100644 --- a/src/diff.h +++ b/src/diff.h @@ -28,6 +28,9 @@ enum { GIT_DIFFCAPS_USE_DEV = (1 << 4), /* use st_dev? */ }; +#define GIT_DELTA__TO_DELETE 10 +#define GIT_DELTA__TO_SPLIT 11 + struct git_diff_list { git_refcount rc; git_repository *repo; |