1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

Checkout master before attempting to pull from remote

This commit is contained in:
Rick Winfrey 2016-10-11 11:07:51 -05:00
parent a8c133879c
commit 1b80b748d7

View File

@ -204,6 +204,7 @@ commands metaSyntax@JSONMetaSyntax{..} =
runPullGitRemote :: String -> FilePath -> IO ()
runPullGitRemote repoUrl repoPath = do
Prelude.putStrLn "Attempting to fetch from the remote repository."
_ <- executeCommand repoPath checkoutMasterCommand
result <- attempt
handle result next errorHandler
where attempt :: IO (Either Prelude.IOError String)
@ -256,6 +257,9 @@ addSubmoduleCommand repoUrl repoPath = "git submodule add " <> repoUrl <> " " <>
getLastCommitShaCommand :: String
getLastCommitShaCommand = "git log --pretty=format:\"%H\" -n 1;"
checkoutMasterCommand :: String
checkoutMasterCommand = "git checkout master;"
pullFromRemoteCommand :: String
pullFromRemoteCommand = "git pull origin master;"