Fix opening
This commit is contained in:
parent
3705c9c0ea
commit
219349e95a
@ -32,8 +32,9 @@ doMakePublic userId submissionId chan = do
|
|||||||
|
|
||||||
app <- getYesod
|
app <- getYesod
|
||||||
let scheme = appRepoScheme $ appSettings app
|
let scheme = appRepoScheme $ appSettings app
|
||||||
|
let repoHost = appRepoHost $ appSettings app
|
||||||
|
|
||||||
let targetRepoUrl = getPublicSubmissionUrl scheme (Just repo) $ challengeName challenge
|
let targetRepoUrl = getPublicSubmissionUrl scheme repoHost (Just repo) $ challengeName challenge
|
||||||
let targetBranchName = getPublicSubmissionBranch submissionId
|
let targetBranchName = getPublicSubmissionBranch submissionId
|
||||||
msg chan $ "Start pushing from " ++ (T.pack submissionRepoDir) ++ " to repo " ++ targetRepoUrl ++ ", branch " ++ targetBranchName ++ " ..."
|
msg chan $ "Start pushing from " ++ (T.pack submissionRepoDir) ++ " to repo " ++ targetRepoUrl ++ ", branch " ++ targetBranchName ++ " ..."
|
||||||
let commit = submissionCommit submission
|
let commit = submissionCommit submission
|
||||||
|
@ -70,9 +70,9 @@ gitReadOnlyServer = "git://" ++ serverAddress ++ "/"
|
|||||||
getPublicSubmissionBranch :: SubmissionId -> Text
|
getPublicSubmissionBranch :: SubmissionId -> Text
|
||||||
getPublicSubmissionBranch = T.pack . (printf "submission-%05d") . fromSqlKey
|
getPublicSubmissionBranch = T.pack . (printf "submission-%05d") . fromSqlKey
|
||||||
|
|
||||||
getPublicSubmissionUrl :: RepoScheme -> Maybe Repo -> Text -> Text
|
getPublicSubmissionUrl :: RepoScheme -> Text -> Maybe Repo -> Text -> Text
|
||||||
getPublicSubmissionUrl SelfHosted _ bareRepoName = gitServer ++ bareRepoName
|
getPublicSubmissionUrl SelfHosted repoHost _ bareRepoName = repoHost ++ bareRepoName
|
||||||
getPublicSubmissionUrl Branches (Just repo) _ = repoUrl repo
|
getPublicSubmissionUrl Branches _ (Just repo) _ = repoUrl repo
|
||||||
|
|
||||||
getReadOnlySubmissionUrl :: RepoScheme -> Repo -> Text -> Text
|
getReadOnlySubmissionUrl :: RepoScheme -> Repo -> Text -> Text
|
||||||
getReadOnlySubmissionUrl SelfHosted _ bareRepoName = gitReadOnlyServer ++ bareRepoName
|
getReadOnlySubmissionUrl SelfHosted _ bareRepoName = gitReadOnlyServer ++ bareRepoName
|
||||||
|
Loading…
Reference in New Issue
Block a user