]> git.proxmox.com Git - libgit2.git/commitdiff
Fixed handling of GIT_DELTA_CONFLICTED in git_diff_find_similar()
authorPierre-Olivier Latour <pol@mac.com>
Wed, 10 Jun 2015 17:09:10 +0000 (10:09 -0700)
committerPierre-Olivier Latour <pol@mac.com>
Wed, 10 Jun 2015 17:09:10 +0000 (10:09 -0700)
git_diff_find_similar() now ignores git_diff_delta records with a status
of GIT_DELTA_CONFLICTED, which fixes a crash due to assert() being hit.

src/diff_tform.c

index 7d84635734f7717a2fd11001277faa0635135ce4..03dd9c9f74c115d10c2a542572ae39c4301e3cbc 100644 (file)
@@ -676,11 +676,13 @@ static bool is_rename_target(
                return false;
 
        /* only consider ADDED, RENAMED, COPIED, and split MODIFIED as
-        * targets; maybe include UNTRACKED and IGNORED if requested.
+        * targets; maybe include UNTRACKED if requested.
         */
        switch (delta->status) {
        case GIT_DELTA_UNMODIFIED:
        case GIT_DELTA_DELETED:
+       case GIT_DELTA_IGNORED:
+       case GIT_DELTA_CONFLICTED:
                return false;
 
        case GIT_DELTA_MODIFIED:
@@ -707,9 +709,6 @@ static bool is_rename_target(
                        return false;
                break;
 
-       case GIT_DELTA_IGNORED:
-               return false;
-
        default: /* all other status values should be checked */
                break;
        }
@@ -735,6 +734,7 @@ static bool is_rename_source(
        case GIT_DELTA_UNTRACKED:
        case GIT_DELTA_UNREADABLE:
        case GIT_DELTA_IGNORED:
+       case GIT_DELTA_CONFLICTED:
                return false;
 
        case GIT_DELTA_DELETED: