]> git.scottworley.com Git - annex-ec/commitdiff
Escape glob characters in filenames in gitattributes
authorScott Worley <scottworley@scottworley.com>
Wed, 8 Apr 2026 15:46:13 +0000 (08:46 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 8 Apr 2026 15:46:13 +0000 (08:46 -0700)
annex-ec

index 474175934b16f1b7f3c0b987133d653c777623d5..a8cf2981e76c4af6e510a1be22c6236b6ec3ee35 100755 (executable)
--- a/annex-ec
+++ b/annex-ec
@@ -118,7 +118,12 @@ for f in ec/"$name.vol"*;do
 done
 
 for f;do
-  echo "${f// /[[:space:]]} annex.numcopies=1" >> .gitattributes
+  f=${f//\\/\\\\}
+  f=${f//\[/\\[}
+  f=${f//\*/\\*}
+  f=${f//\?/\\?}
+  f=${f// /[[:space:]]}
+  echo "$f annex.numcopies=1" >> .gitattributes
 done
 
 for volume in here "${volumes[@]}";do