on master help sign in
Fix some docs and names
commitce21683afdb6f66124b05421d91ec15c7fb5ff58 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateMon 15 Oct 2018, 14:37 (8 years ago) parent5c914ce
1 file changed+13−13
lib/command/src/Obelisk/Command/Thunk.hs+13−13
lib/command/src/Obelisk/Command/Thunk.hs+13−13
@@ -712,8 +712,8 @@ getThunkPtr' checkClean thunkDir upstream = do
712712 <|> Map.lookup currentHead localHeads
713713 let src = uriToThunkSource remoteUri mCurrentUpstreamBranch
714714 rev <- case src of
715− ThunkSource_GitHub s -> githubThunkPtr s currentHead
716− ThunkSource_Git s -> gitThunkPtr s currentHead
715+ ThunkSource_GitHub s -> githubThunkRev s currentHead
716+ ThunkSource_Git s -> gitThunkRev s currentHead
717717 pure $ ThunkPtr
718718 { _thunkPtr_rev = rev
719719 , _thunkPtr_source = src
@@ -730,16 +730,16 @@ getLatestRev os = do
730730 ThunkSource_Git s -> s
731731 (_, commit) <- gitGetCommitBranch (_gitSource_url gitS) (untagName <$> _gitSource_branch gitS)
732732 case os of
733− ThunkSource_GitHub s -> githubThunkPtr s commit
734− ThunkSource_Git s -> gitThunkPtr s commit
733+ ThunkSource_GitHub s -> githubThunkRev s commit
734+ ThunkSource_Git s -> gitThunkRev s commit
735735
736736uriThunkPtr :: MonadObelisk m => URI -> Maybe Text -> m ThunkPtr
737737uriThunkPtr uri mbranch = do
738738 (_, commit) <- gitGetCommitBranch uri mbranch
739739 let src = uriToThunkSource uri mbranch
740740 rev <- case src of
741− ThunkSource_GitHub s -> githubThunkPtr s commit
742− ThunkSource_Git s -> gitThunkPtr s commit
741+ ThunkSource_GitHub s -> githubThunkRev s commit
742+ ThunkSource_Git s -> gitThunkRev s commit
743743 pure $ ThunkPtr
744744 { _thunkPtr_rev = rev
745745 , _thunkPtr_source = src
@@ -776,13 +776,13 @@ uriToThunkSource u
776776 }
777777
778778-- Funny signature indicates no effects depend on the optional branch name.
779−githubThunkPtr
779+githubThunkRev
780780 :: forall m
781781 . MonadObelisk m
782782 => GitHubSource
783783 -> Text
784784 -> m ThunkRev
785−githubThunkPtr s commit = do
785+githubThunkRev s commit = do
786786 owner <- forcePP $ _gitHubSource_owner s
787787 repo <- forcePP $ _gitHubSource_repo s
788788 revTarball <- mkPathPiece $ commit <> ".tar.gz"
@@ -809,12 +809,12 @@ githubThunkPtr s commit = do
809809 forcePP :: Name entity -> m (RText 'PathPiece)
810810 forcePP = mkPathPiece . untagName
811811
812−gitThunkPtr
812+gitThunkRev
813813 :: MonadObelisk m
814814 => GitSource
815815 -> Text
816816 -> m ThunkRev
817−gitThunkPtr s commit = do
817+gitThunkRev s commit = do
818818 let u = _gitSource_url s
819819 protocols = ["https", "ssh", "git"]
820820 Just scheme <- pure $ unRText <$> uriScheme u
@@ -828,13 +828,13 @@ gitThunkPtr s commit = do
828828 , _thunkRev_nixSha256 = hash
829829 }
830830
831−-- | Given the URI to a git remote, and an optional branch name, return the
832−-- commit hash of the tip of that branch along with the name of the branch.
831+-- | Given the URI to a git remote, and an optional branch name, return the name
832+-- of the branch along with the hash of the commit at tip of that branch.
833833--
834834-- If the branch name is passed in, it is returned exactly as-is. If it is not
835835-- passed it, the default branch of the repo is used instead.
836836gitGetCommitBranch
837− :: MonadObelisk m => URI -> Maybe Text -> m (Text, Text)
837+ :: MonadObelisk m => URI -> Maybe Text -> m (Text, CommitId)
838838gitGetCommitBranch uri mbranch = withExitFailMessage ("Failure for git remote " <> uriMsg) $ do
839839 bothMaps <- rethrowE =<< liftIO (gitLsRemote (show uri) (GitRef_Branch <$> mbranch))
840840 branch <- case mbranch of