]> git.armaanb.net Git - stagit.git/commitdiff
don't use a heuristic for renames, the content must match exactly
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 18 Nov 2018 17:07:22 +0000 (18:07 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 18 Nov 2018 17:07:22 +0000 (18:07 +0100)
this prevents showing files as renames when most (but not all) of the file was
changed.

stagit.c

index 8a7e7fc4d5c02bc6ba6bacb8e981058f8833b789..b2741c047eb5e9562c0ad5fb6865abd6ff3891f8 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -122,7 +122,9 @@ commitinfo_getstats(struct commitinfo *ci)
 
        if (git_diff_find_init_options(&fopts, GIT_DIFF_FIND_OPTIONS_VERSION))
                goto err;
-       fopts.flags |= GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES;
+       /* find renames and copies, exact matches (no heuristic) for renames. */
+       fopts.flags |= GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES |
+                      GIT_DIFF_FIND_EXACT_MATCH_ONLY;
        if (git_diff_find_similar(ci->diff, &fopts))
                goto err;