@@ -123,25 +123,15 @@ gitLsRemote
123123 :: MonadObelisk m
124124 => String
125125 -> Maybe GitRef
126− -> m GitLsRemoteMaps
127−gitLsRemote repository mRef = do
128− t <- readProc $ gitProcNoRepo $
129− ["ls-remote", "--symref", repository]
130− ++ (maybeToList $ T.unpack . showGitRef <$> mRef)
131− maps <- case MP.runParser parseLsRemote "" t of
132− Left err -> failWith $ T.pack $ MP.parseErrorPretty' t err
133− Right table -> pure $ bimap M.fromList M.fromList $ partitionEithers $ table
134− putLog Debug $ "git ls-remote maps: " <> T.pack (show maps)
135− pure maps
136−
137−gitLsRemoteExitCode
138− :: MonadObelisk m
139− => String
140− -> String
126+ -> Maybe String
141127 -> m (ExitCode, GitLsRemoteMaps)
142−gitLsRemoteExitCode repository branchName = do
143− (exitCode, out, _err) <- readCreateProcessWithExitCode $ gitProcNoRepo $
144− ["ls-remote", "--exit-code", repository, branchName]
128+gitLsRemote repository mRef mBranch = do
129+ (exitCode, out, _err) <- case mBranch of
130+ Nothing -> readCreateProcessWithExitCode $ gitProcNoRepo $
131+ ["ls-remote", "--exit-code", "--symref", repository]
132+ ++ (maybeToList $ T.unpack . showGitRef <$> mRef)
133+ Just branchName -> readCreateProcessWithExitCode $ gitProcNoRepo $
134+ ["ls-remote", "--exit-code", repository, branchName]
145135 let t = T.pack out
146136 maps <- case MP.runParser parseLsRemote "" t of
147137 Left err -> failWith $ T.pack $ MP.parseErrorPretty' t err