+10
-5
@@ -333,13 +333,17 @@ gitCommitAll logger repoPath = do
|
|||||||
-- | Pull from the configured remote, rebasing onto the tracked upstream branch.
|
-- | Pull from the configured remote, rebasing onto the tracked upstream branch.
|
||||||
gitPull :: Logger -> RepoConfig -> IO (ExitCode, Text, Text)
|
gitPull :: Logger -> RepoConfig -> IO (ExitCode, Text, Text)
|
||||||
gitPull logger repo =
|
gitPull logger repo =
|
||||||
loggedGit logger (rcPath repo)
|
loggedGit
|
||||||
|
logger
|
||||||
|
(rcPath repo)
|
||||||
["pull", "--rebase", T.unpack (rcRemote repo)]
|
["pull", "--rebase", T.unpack (rcRemote repo)]
|
||||||
|
|
||||||
-- | Push to the configured remote and branch.
|
-- | Push to the configured remote and branch.
|
||||||
gitPush :: Logger -> RepoConfig -> IO (ExitCode, Text, Text)
|
gitPush :: Logger -> RepoConfig -> IO (ExitCode, Text, Text)
|
||||||
gitPush logger repo =
|
gitPush logger repo =
|
||||||
loggedGit logger (rcPath repo)
|
loggedGit
|
||||||
|
logger
|
||||||
|
(rcPath repo)
|
||||||
["push", T.unpack (rcRemote repo), T.unpack (rcBranch repo)]
|
["push", T.unpack (rcRemote repo), T.unpack (rcBranch repo)]
|
||||||
|
|
||||||
-- | Run a git command and log the invocation and exit code.
|
-- | Run a git command and log the invocation and exit code.
|
||||||
@@ -348,9 +352,10 @@ loggedGit logger repoPath args = do
|
|||||||
logInfo logger ("RUN: git -C " <> T.pack repoPath <> " " <> T.intercalate " " (map T.pack args))
|
logInfo logger ("RUN: git -C " <> T.pack repoPath <> " " <> T.intercalate " " (map T.pack args))
|
||||||
result@(code, _, err) <- runGitIn repoPath args
|
result@(code, _, err) <- runGitIn repoPath args
|
||||||
let msg = "EXIT " <> T.pack (show code)
|
let msg = "EXIT " <> T.pack (show code)
|
||||||
details = if code /= ExitSuccess && not (T.null err)
|
details =
|
||||||
then ": " <> T.strip err
|
if code /= ExitSuccess && not (T.null err)
|
||||||
else ""
|
then ": " <> T.strip err
|
||||||
|
else ""
|
||||||
logInfo logger (msg <> details)
|
logInfo logger (msg <> details)
|
||||||
pure result
|
pure result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user