diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-02-03 14:36:14 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-02-03 14:36:14 -0400 |
commit | 861f8f0e2d84c60106d4f9950ae4f96f677229c5 (patch) | |
tree | 9ab3b987754b679290d127f9bf0402f95722d9a2 /Command | |
parent | c438a610208b1914932980a26c0ab90fb544cd34 (diff) |
make sync --no-commit override annex.annex.autocommit
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Sync.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 581cad562..37fc343e7 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -66,6 +66,7 @@ cmd = withGlobalOptions [jobsOption] $ data SyncOptions = SyncOptions { syncWith :: CmdParams , commitOption :: Bool + , noCommitOption :: Bool , messageOption :: Maybe String , pullOption :: Bool , pushOption :: Bool @@ -80,8 +81,13 @@ optParser desc = SyncOptions ( metavar desc <> completeRemotes )) - <*> invertableSwitch "commit" True - ( help "avoid git commit" + <*> switch + ( long "commit" + <> help "commit changes to git" + ) + <*> switch + ( long "no-commit" + <> help "avoid git commit" ) <*> optional (strOption ( long "message" <> short 'm' <> metavar "MSG" @@ -246,7 +252,7 @@ commit o = stopUnless shouldcommit $ next $ next $ do ) where shouldcommit = pure (commitOption o) - <&&> getGitConfigVal annexAutoCommit + <||> (pure (not (noCommitOption o)) <&&> getGitConfigVal annexAutoCommit) commitMsg :: Annex String commitMsg = do |