summaryrefslogtreecommitdiffstats
path: root/shunit/shunit2_test_helpers
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2026-04-30 01:32:54 -0400
committerMatt Hunter <m@lfurio.us>2026-05-07 19:56:04 -0400
commitedf22dc5e40b3cdfe9beaf3365002ccb3cd527c2 (patch)
tree17a86a35d18fcd506374ff21ee880c77f97c8bb3 /shunit/shunit2_test_helpers
parentcee3f0443ff992a8f64f13d66da4867d1db836de (diff)
downloadgit-sonar-edf22dc5e40b3cdfe9beaf3365002ccb3cd527c2.tar.gz
git-sonar-edf22dc5e40b3cdfe9beaf3365002ccb3cd527c2.zip
Fix unmerged paths being double counted in status
There are a couple edge-cases that these basic regexes over the status indicators might double count as different change stages. These involve the status symbols used for unmerged paths. For instance, "DD $path" is printed for a conflicted file which has been deleted by both sides of a merge. However, "D" is a valid character for both regular staged and unstaged file deletions. Catch and filter out these problematic "unmerged path" cases by replacing one of the duplicate characters in them with a "U". Paths will only ever contain a "U" on either side of their status if they are in an unmerged state, and will thus prevent the staged/unstaged regexes from matching them. This solution works for git-sonar, since we don't care to distinguish between AA/AU/UA or DD/DU/UD. We simply report whether any unmerged path involved an "addded" or "deleted" status on either side, as opposed to more common "both modified (UU)" cases. Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions