mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 21:03:22 +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:
@@ -9,11 +9,12 @@ import (
|
||||
|
||||
// Returns the combined stdout / stderr for an individual Build.
|
||||
func BuildOut(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) error {
|
||||
branch := r.FormValue(":branch")
|
||||
hash := r.FormValue(":commit")
|
||||
labl := r.FormValue(":label")
|
||||
|
||||
// get the commit from the database
|
||||
commit, err := database.GetCommitHash(hash, repo.ID)
|
||||
commit, err := database.GetCommitBranchHash(branch, hash, repo.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user