init: Configure .git/info/attributes to use git-annex as a smudge filter.

Note that this changes the default behavior of git add in a newly
initialized repository; it will add files to the annex.

Don't like that this could break workflows, but it's necessary in order for
any pointer files in the repo to be handled by git-annex.
This commit is contained in:
Joey Hess 2015-12-04 17:57:15 -04:00
parent fb6ebdaae7
commit 2fe21d47c5
Failed to extract signature
6 changed files with 60 additions and 21 deletions

8
Git.hs
View file

@ -28,6 +28,7 @@ module Git (
repoPath,
localGitDir,
attributes,
attributesLocal,
hookPath,
assertLocal,
adjustPath,
@ -125,8 +126,11 @@ assertLocal repo action
{- Path to a repository's gitattributes file. -}
attributes :: Repo -> FilePath
attributes repo
| repoIsLocalBare repo = repoPath repo ++ "/info/.gitattributes"
| otherwise = repoPath repo ++ "/.gitattributes"
| repoIsLocalBare repo = attributesLocal repo
| otherwise = repoPath repo </> ".gitattributes"
attributesLocal :: Repo -> FilePath
attributesLocal repo = localGitDir repo </> "info" </> "attributes"
{- Path to a given hook script in a repository, only if the hook exists
- and is executable. -}