mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 06:48:57 +00:00
query and show commits by branch
This allows the same SHA to have different builds on different branches, each separately viewable. This is useful for expressing a "pipeline" in terms of branches, e.g. a commit starts on branch A and progress through B and C to master, with the build script switching on branch name. Previously viewing each build would arbitrarily choose which branch's commit to show.
This commit is contained in:
@@ -74,7 +74,7 @@ func (h *HookHandler) Hook(w http.ResponseWriter, r *http.Request) error {
|
||||
|
||||
// Verify that the commit doesn't already exist.
|
||||
// We should never build the same commit twice.
|
||||
_, err = database.GetCommitHash(hook.Head.Id, repo.ID)
|
||||
_, err = database.GetCommitBranchHash(hook.Branch(), hook.Head.Id, repo.ID)
|
||||
if err != nil && err != sql.ErrNoRows {
|
||||
println("commit already exists")
|
||||
return RenderText(w, http.StatusText(http.StatusBadGateway), http.StatusBadGateway)
|
||||
|
||||
Reference in New Issue
Block a user