summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-15 18:11:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-15 18:19:36 -0400
commit95d2391f58ae240e7100f0d5488dd7246f71f3bb (patch)
treef33f21904ae7be4d40b70bab1e2a68fd4eef5526 /Command/Sync.hs
parentb7e0d39abbc9a09c21c6f0103ad6c9f4547f81fe (diff)
more partial function removal
Left a few Prelude.head's in where it was checked not null and too hard to remove, etc.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index a25bcad8c..36c4eeef0 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -12,6 +12,8 @@ import Command
import qualified Annex.Branch
import qualified Git.Command
import qualified Git.Config
+import qualified Git.Ref
+import qualified Git
import qualified Data.ByteString.Lazy.Char8 as L
@@ -61,7 +63,7 @@ defaultRemote = do
fromRepo $ Git.Config.get ("branch." ++ branch ++ ".remote") "origin"
currentBranch :: Annex String
-currentBranch = last . split "/" . L.unpack . head . L.lines <$>
+currentBranch = Git.Ref.describe . Git.Ref . firstLine . L.unpack <$>
inRepo (Git.Command.pipeRead [Param "symbolic-ref", Param "HEAD"])
checkRemote :: String -> Annex ()