aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/Drop.hs8
-rw-r--r--Assistant/Alert.hs4
-rw-r--r--Command/Sync.hs2
3 files changed, 7 insertions, 7 deletions
diff --git a/Annex/Drop.hs b/Annex/Drop.hs
index 61b0cf9e1..71263dc61 100644
--- a/Annex/Drop.hs
+++ b/Annex/Drop.hs
@@ -48,10 +48,10 @@ handleDropsFrom locs rs reason fromhere key afile knownpresentremote runner = do
fs <- ifM isDirect
( do
l <- associatedFilesRelative key
- if null l
- then return $ maybe [] (:[]) afile
- else return l
- , return $ maybe [] (:[]) afile
+ return $ if null l
+ then maybeToList afile
+ else l
+ , return $ maybeToList afile
)
n <- getcopies fs
if fromhere && checkcopies n Nothing
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 58264cfbf..192952f56 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -253,7 +253,7 @@ upgradingAlert = activityAlert Nothing [ fromString "Upgrading git-annex" ]
upgradeFinishedAlert :: Maybe AlertButton -> GitAnnexVersion -> Alert
upgradeFinishedAlert button version =
- baseUpgradeAlert (maybe [] (:[]) button) $ fromString $
+ baseUpgradeAlert (maybeToList button) $ fromString $
"Finished upgrading git-annex to version " ++ version
upgradeFailedAlert :: String -> Alert
@@ -317,7 +317,7 @@ pairRequestAcknowledgedAlert who button = baseActivityAlert
, alertPriority = High
, alertName = Just $ PairAlert who
, alertCombiner = Just $ dataCombiner $ \_old new -> new
- , alertButtons = maybe [] (:[]) button
+ , alertButtons = maybeToList button
}
xmppNeededAlert :: AlertButton -> Alert
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 04d91adee..5bc412cc9 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -158,7 +158,7 @@ commitStaged commitmessage = go =<< inRepo Git.Branch.currentUnsafe
go (Just branch) = do
parent <- inRepo $ Git.Ref.sha branch
void $ inRepo $ Git.Branch.commit False commitmessage branch
- (maybe [] (:[]) parent)
+ (maybeToList parent)
return True
mergeLocal :: Maybe Git.Ref -> CommandStart