diff options
author | Russell Belfer <rb@github.com> | 2013-06-14 16:18:04 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-17 10:03:49 -0700 |
commit | a1683f28ce2709e615490939e4e244046654d0e5 (patch) | |
tree | 8eae4e60603cac390a5da9a3cbb745ea0e4b2644 /src/diff.h | |
parent | fb03a223189f418d0767d7d04ff7509dfcfe8394 (diff) | |
download | libgit2-a1683f28ce2709e615490939e4e244046654d0e5.tar.gz |
More tests and bug fixes for status with rename
This changes the behavior of the status RENAMED flags so that they
will be combined with the MODIFIED flags if appropriate. If a file
is modified in the index and also renamed, then the status code
will have both the GIT_STATUS_INDEX_MODIFIED and INDEX_RENAMED bits
set. If it is renamed but the OID has not changed, then just the
GIT_STATUS_INDEX_RENAMED bit will be set. Similarly, the flags
GIT_STATUS_WT_MODIFIED and GIT_STATUS_WT_RENAMED can both be set
independently of one another.
This fixes a serious bug where the check for unmodified files that
was done at data load time could end up erasing the RENAMED state
of a file that was renamed with no changes.
Lastly, this contains a bunch of new tests for status with renames,
including tests where the only rename changes are case changes.
The expected results of these tests have to vary by whether the
platform uses a case sensitive filesystem or not, so the expected
data covers those platform differences separately.
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/diff.h b/src/diff.h index 1536f79d7..6ef03ee7c 100644 --- a/src/diff.h +++ b/src/diff.h @@ -95,17 +95,16 @@ extern int git_diff__paired_foreach( int (*cb)(git_diff_delta *i2h, git_diff_delta *w2i, void *payload), void *payload); -int git_diff_find_similar__hashsig_for_file( +extern int git_diff_find_similar__hashsig_for_file( void **out, const git_diff_file *f, const char *path, void *p); -int git_diff_find_similar__hashsig_for_buf( +extern int git_diff_find_similar__hashsig_for_buf( void **out, const git_diff_file *f, const char *buf, size_t len, void *p); -void git_diff_find_similar__hashsig_free(void *sig, void *payload); +extern void git_diff_find_similar__hashsig_free(void *sig, void *payload); -int git_diff_find_similar__calc_similarity( +extern int git_diff_find_similar__calc_similarity( int *score, void *siga, void *sigb, void *payload); - #endif |