summaryrefslogtreecommitdiff
path: root/Annex/Version.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Version.hs')
-rw-r--r--Annex/Version.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Annex/Version.hs b/Annex/Version.hs
index 935f777ab..9e694faf1 100644
--- a/Annex/Version.hs
+++ b/Annex/Version.hs
@@ -26,12 +26,10 @@ versionField :: String
versionField = "annex.version"
getVersion :: Annex (Maybe Version)
-getVersion = do
- g <- gitRepo
- let v = Git.configGet g versionField ""
- if not $ null v
- then return $ Just v
- else return Nothing
+getVersion = handle <$> fromRepo (Git.configGet versionField "")
+ where
+ handle [] = Nothing
+ handle v = Just v
setVersion :: Annex ()
setVersion = setConfig versionField defaultVersion