summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 22:23:04 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-06 22:23:04 -0400
commit6d9eb8da566c410c7780e15625dfed3f76a3e8f8 (patch)
tree159edb98ccb910dcd0d407859e1cc874af509ba4 /Command/Sync.hs
parent3e9ff821877b9f7a5b486bffe6dac2f31ac5887b (diff)
handle sync's use of setCurrentDirectory to work with relative paths
I think this is the last problimatic setCurrentDirectory. I also audited for extrnal commands that git-annex might run with cwd = foo, and did not find any that were passed any FilePath that might be absolute.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 2299306ed..0433153b1 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -29,6 +29,7 @@ import Annex.Hook
import qualified Git.Command
import qualified Git.LsFiles as LsFiles
import qualified Git.Branch
+import qualified Git.Types as Git
import qualified Git.Ref
import qualified Git
import qualified Remote.Git
@@ -107,7 +108,7 @@ seek rs = do
- of the repo. This also means that sync always acts on all files in the
- repository, not just on a subdirectory. -}
prepMerge :: Annex ()
-prepMerge = liftIO . setCurrentDirectory =<< fromRepo Git.repoPath
+prepMerge = Annex.changeDirectory =<< fromRepo Git.repoPath
syncBranch :: Git.Ref -> Git.Ref
syncBranch = Git.Ref.under "refs/heads/synced" . fromDirectBranch