summaryrefslogtreecommitdiff
path: root/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 17:57:15 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 17:57:15 -0400
commitcf9af38cf75618e2953c5b537d8f7c1fe353aa63 (patch)
treeb5945e5f46eab01366ab3ddbe96662f9b8d96aa3 /Git.hs
parent93eaf6d6d018fe9df5b985e47300f549e4b04709 (diff)
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.
Diffstat (limited to 'Git.hs')
-rw-r--r--Git.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Git.hs b/Git.hs
index 1bc789f85..6f7769c87 100644
--- a/Git.hs
+++ b/Git.hs
@@ -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. -}