diff options
| author | Matt Hunter <m@lfurio.us> | 2026-04-30 01:32:54 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-05-07 19:56:04 -0400 |
| commit | edf22dc5e40b3cdfe9beaf3365002ccb3cd527c2 (patch) | |
| tree | 17a86a35d18fcd506374ff21ee880c77f97c8bb3 /LICENSE | |
| parent | cee3f0443ff992a8f64f13d66da4867d1db836de (diff) | |
| download | git-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 'LICENSE')
0 files changed, 0 insertions, 0 deletions
