Propigate GIT_DIR and GIT_WORK_TREE environment to external special remotes.
Since git-annex unsets these when started, they have to be explicitly propigated. Also, this makes --git-dir and --work-tree settings be reflected in the environment. The need for this came up in https://github.com/DanielDent/git-annex-remote-rclone/issues/3
This commit is contained in:
parent
36137c444b
commit
6659c7ec0e
4 changed files with 25 additions and 4 deletions
5
Git.hs
5
Git.hs
|
@ -26,6 +26,7 @@ module Git (
|
|||
repoDescribe,
|
||||
repoLocation,
|
||||
repoPath,
|
||||
repoWorkTree,
|
||||
localGitDir,
|
||||
attributes,
|
||||
attributesLocal,
|
||||
|
@ -73,6 +74,10 @@ repoPath Repo { location = Local { gitdir = d } } = d
|
|||
repoPath Repo { location = LocalUnknown dir } = dir
|
||||
repoPath Repo { location = Unknown } = error "unknown repoPath"
|
||||
|
||||
repoWorkTree :: Repo -> Maybe FilePath
|
||||
repoWorkTree Repo { location = Local { worktree = Just d } } = Just d
|
||||
repoWorkTree _ = Nothing
|
||||
|
||||
{- Path to a local repository's .git directory. -}
|
||||
localGitDir :: Repo -> FilePath
|
||||
localGitDir Repo { location = Local { gitdir = d } } = d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue