Additional GIT_DIR support bugfixes. May actually work now.
Two fixes. First, and most importantly, relax the isLinkToAnnex check to only look for /annex/objects/, not [^|/].git/annex/objects. If GIT_DIR is used with a detached work tree, the git directory is not necessarily named .git. There are important caveats with doing that at all, since git-annex will make symlinks that point at GIT_DIR, which means that the relative path between GIT_DIR and GIT_WORK_TREE needs to remain stable across all clones of the repository. ---- The other fix is just fixing crazy and wrong code that, when GIT_DIR is set, expects to still find a git repository in the path below the work tree, and uses some of its configuration, and some of GIT_DIR. What was I thinking, and why can't I seem to get this code right?
This commit is contained in:
parent
acc3c8c157
commit
8d9c2afd89
4 changed files with 24 additions and 20 deletions
11
Locations.hs
11
Locations.hs
|
@ -236,11 +236,14 @@ gitAnnexRemotesDir r = addTrailingPathSeparator $ gitAnnexDir r </> "remotes"
|
|||
gitAnnexAssistantDefaultDir :: FilePath
|
||||
gitAnnexAssistantDefaultDir = "annex"
|
||||
|
||||
{- Checks a symlink target to see if it appears to point to annexed content. -}
|
||||
{- Checks a symlink target to see if it appears to point to annexed content.
|
||||
-
|
||||
- We only look at paths inside the .git directory, and not at the .git
|
||||
- directory itself, because GIT_DIR may cause a directory name other
|
||||
- than .git to be used.
|
||||
-}
|
||||
isLinkToAnnex :: FilePath -> Bool
|
||||
isLinkToAnnex s = ('/':d) `isInfixOf` s || d `isPrefixOf` s
|
||||
where
|
||||
d = ".git" </> objectDir
|
||||
isLinkToAnnex s = ('/':objectDir) `isInfixOf` s
|
||||
|
||||
{- Converts a key into a filename fragment without any directory.
|
||||
-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue