torbiak / git-autofixup

create fixup commits for topic branches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle quoted filenames in diffs

torbiak opened this issue · comments

As @krobelus mentioned here, Git quotes filenames that use unusual characters. Looks like we need to match quoted filenames and expand any escapes. For example:

$ git -c core.quotePath=false show --raw -p
commit c1235ca87f96496455721139af7fe8ea19b119fe (HEAD -> main)
Author: Jordan Torbiak <torbiak@gmail.com>
Date:   Sun Mar 28 18:08:50 2021 -0600

    wierd name

:000000 100644 0000000 45b983b A        "wierd\"name"

diff --git "a/wierd\"name" "b/wierd\"name"
new file mode 100644
index 0000000..45b983b
--- /dev/null
+++ "b/wierd\"name"
@@ -0,0 +1 @@
+hi