Add -- before %f in the smudge/clean filter configuration

To support filenames starting with dashes.

To update the config of existing repositories, you can re-run git-annex init.

Perhaps it should check every time for the old config and update it, but
that has several problems:

	- read-only repos
	- unexpected commands like `git annex find` changing git configs
	  might be surprising behavior

Since filenames starting with dashes are not super common and the user can
re-init easily enough if their repo needs fixed, I went for the simplest
fix.
This commit is contained in:
Joey Hess 2019-03-18 14:12:13 -04:00
parent e7f3e2a937
commit 60ca3ce043
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 34 additions and 2 deletions

View file

@ -24,8 +24,8 @@ configureSmudgeFilter = unlessM (fromRepo Git.repoIsLocalBare) $ do
-- Avoid that problem by running git status now.
inRepo $ Git.Command.runQuiet [Param "status", Param "--porcelain"]
setConfig (ConfigKey "filter.annex.smudge") "git-annex smudge %f"
setConfig (ConfigKey "filter.annex.clean") "git-annex smudge --clean %f"
setConfig (ConfigKey "filter.annex.smudge") "git-annex smudge -- %f"
setConfig (ConfigKey "filter.annex.clean") "git-annex smudge --clean -- %f"
lf <- Annex.fromRepo Git.attributesLocal
gf <- Annex.fromRepo Git.attributes
lfs <- readattr lf