summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-30 18:36:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-30 18:36:40 -0400
commit52104dae6f5175f01395a657fd40423d1196604a (patch)
tree804e1f76ee4cd930375d13f70121a634fe675dcd /Command
parent56488e807bcc7dcc6e9f5b3e359ddf4f4fb5d8d1 (diff)
refactor
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs14
1 files changed, 4 insertions, 10 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 1c20c409c..e5f23e63e 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -46,18 +46,12 @@ syncRemotes branch [] = defaultSyncRemotes branch
syncRemotes _ rs = mapM Remote.byName rs
defaultSyncRemotes :: Git.Ref -> Annex [Remote.Remote Annex]
-defaultSyncRemotes syncbranch = mapM Remote.byName
- =<< process . L.unpack <$> inRepo showref
+defaultSyncRemotes syncbranch = mapM Remote.byName =<<
+ map getRemoteName . filter isRemote . map (show . snd) <$>
+ inRepo (Git.Ref.matching $ Git.Ref.base syncbranch)
where
- showref = Git.Command.pipeRead
- [ Param "show-ref"
- , Param $ show $ Git.Ref.base syncbranch
- ]
- process = map getRemoteName . filter isRemote .
- map getBranchName . lines
- isRemote r = "refs/remotes/" `isPrefixOf` r
- getBranchName = snd . separate (== ' ')
getRemoteName = fst . separate (== '/') . snd . separate (== '/') . snd . separate (== '/')
+ isRemote r = "refs/remotes/" `isPrefixOf` r
commit :: CommandStart
commit = do