Skip to content

Commit

Permalink
Recognise /dev/null as a +++ or --- file path
Browse files Browse the repository at this point in the history
Fix for issue ElectricRCAircraftGuy#31 
Update to the regular expression that identifies the source/destination path lines.
  • Loading branch information
camac authored Aug 15, 2024
1 parent 81d0511 commit 857556e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion useful_scripts/git-diffn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ match(raw_line, /^(\033\[(([0-9]{1,2};?){1,10})m)?@@ -([0-9]+),[0-9]+ \+([0-9]+)
# 2. Match uncolored or colored (usually white) lines like this:
# `--- a/my/file` and `+++ b/my/file`, as well as ANY OTHER LINE WHICH DOES
# *NOT* BEGIN WITH A -, +, or space (optional color code at the start accounted for).
/^(\033\[(([0-9]{1,2};?){1,10})m)?(--- a\/|\+\+\+ b\/|[^-+ \033])/ {
/^(\033\[(([0-9]{1,2};?){1,10})m)?(--- (a\/|\/dev\/null)|\+\+\+ (b\/|\/dev\/null)|[^-+ \033])/ {
print raw_line
next
}
Expand Down

0 comments on commit 857556e

Please sign in to comment.