diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-11-28 14:40:26 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-11-28 15:14:16 -0400 |
commit | 699611cde5cda8b2f2d83a6d6ac9c1e575b74f51 (patch) | |
tree | b502247490779aca8068684a3be42791050eff7b /Command/Sync.hs | |
parent | bf5de3a6f3d50028f7ac47c6cde759a6f5110b08 (diff) |
showStart variant for when there's no worktree file
Clean up some uses of showStart with "" for the file,
or in some cases, a non-filename description string. That would
generate bad json, although none of the commands doing that
supported --json.
Using "" for the file resulted in output like "foo rest";
now the extra space is eliminated.
This commit was sponsored by Fernando Jimenez on Patreon.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r-- | Command/Sync.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index b2d0bd275..f63260ed4 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -299,7 +299,7 @@ syncRemotes' ps available = commit :: SyncOptions -> CommandStart commit o = stopUnless shouldcommit $ next $ next $ do commitmessage <- maybe commitMsg return (messageOption o) - showStart "commit" "" + showStart' "commit" Nothing Annex.Branch.commit "update" ifM isDirect ( do @@ -342,7 +342,7 @@ mergeLocal mergeconfig resolvemergeoverride currbranch@(Just _, _) = where go Nothing = stop go (Just syncbranch) = do - showStart "merge" $ Git.Ref.describe syncbranch + showStart' "merge" (Just $ Git.Ref.describe syncbranch) next $ next $ merge currbranch mergeconfig resolvemergeoverride Git.Branch.ManualCommit syncbranch mergeLocal _ _ (Nothing, madj) = do b <- inRepo Git.Branch.currentUnsafe @@ -401,7 +401,7 @@ updateBranch syncbranch updateto g = pullRemote :: SyncOptions -> [Git.Merge.MergeConfig] -> Remote -> CurrBranch -> CommandStart pullRemote o mergeconfig remote branch = stopUnless (pure $ pullOption o && wantpull) $ do - showStart "pull" (Remote.name remote) + showStart' "pull" (Just (Remote.name remote)) next $ do showOutput stopUnless fetch $ @@ -438,7 +438,7 @@ mergeRemote remote currbranch mergeconfig resolvemergeoverride = ifM isBareRepo pushRemote :: SyncOptions -> Remote -> CurrBranch -> CommandStart pushRemote _o _remote (Nothing, _) = stop pushRemote o remote (Just branch, _) = stopUnless (pure (pushOption o) <&&> needpush) $ do - showStart "push" (Remote.name remote) + showStart' "push" (Just (Remote.name remote)) next $ next $ do showOutput ok <- inRepoWithSshOptionsTo (Remote.repo remote) gc $ @@ -651,7 +651,7 @@ syncFile ebloom rs af k = onlyActionOn' k $ do , return [] ) get have = includeCommandAction $ do - showStart' "get" k (mkActionItem af) + showStartKey "get" k (mkActionItem af) next $ next $ getKey' k af have wantput r @@ -703,7 +703,7 @@ seekExportContent rs = or <$> forM rs go cleanupLocal :: CurrBranch -> CommandStart cleanupLocal (Nothing, _) = stop cleanupLocal (Just currb, _) = do - showStart "cleanup" "local" + showStart' "cleanup" (Just "local") next $ next $ do delbranch $ syncBranch currb delbranch $ syncBranch $ Git.Ref.base $ Annex.Branch.name @@ -717,7 +717,7 @@ cleanupLocal (Just currb, _) = do cleanupRemote :: Remote -> CurrBranch -> CommandStart cleanupRemote _ (Nothing, _) = stop cleanupRemote remote (Just b, _) = do - showStart "cleanup" (Remote.name remote) + showStart' "cleanup" (Just (Remote.name remote)) next $ next $ inRepo $ Git.Command.runBool [ Param "push" |