From: Joey Hess Date: Thu, 18 May 2023 14:15:04 +0000 (-0400) Subject: fix inverted logic (fixes test fail) X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~40^2~163 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=935330aaab8e2a3ebeea4a0f3db44851d2652b0b;p=git-annex.git fix inverted logic (fixes test fail) Sponsored-by: Jack Hill on Patreon --- diff --git a/Command/Sync.hs b/Command/Sync.hs index 5918c6d5df..dfdc3a83b2 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -190,12 +190,12 @@ optParser mode desc = SyncOptions <> help "transfer contents of annexed files in a given location" <> metavar paramPath )) - <*> unlessmode PullMode False (switch + <*> whenmode PullMode False (switch ( long "cleanup" <> help "remove synced/ branches from previous sync" )) <*> optional parseAllOption - <*> unlessmode PushMode False (invertableSwitch "resolvemerge" True + <*> whenmode PushMode False (invertableSwitch "resolvemerge" True ( help "do not automatically resolve merge conflicts" )) <*> case mode of @@ -204,8 +204,11 @@ optParser mode desc = SyncOptions <*> pure mode where unlessmode m v a - | mode /= m = a - | otherwise = pure v + | mode /= m = pure v + | otherwise = a + whenmode m v a + | mode == m = pure v + | otherwise = a parseUnrelatedHistoriesOption :: Parser Bool parseUnrelatedHistoriesOption =