test commit
This commit is contained in:
@@ -160,6 +160,23 @@ func (h *RepoHandler) Blob(w http.ResponseWriter, r *http.Request) {
|
||||
jsonOK(w, map[string]string{"content": string(content), "path": path, "ref": ref})
|
||||
}
|
||||
|
||||
func (h *RepoHandler) Branches(w http.ResponseWriter, r *http.Request) {
|
||||
repo, ok := h.lookupRepo(w, r)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
gitdomain.SetRepoRoot(h.cfg.RepoRoot)
|
||||
branches, err := gitdomain.Branches(repo.DiskPath)
|
||||
if err != nil {
|
||||
jsonError(w, "could not list branches", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if branches == nil {
|
||||
branches = []gitdomain.Branch{}
|
||||
}
|
||||
jsonOK(w, branches)
|
||||
}
|
||||
|
||||
func (h *RepoHandler) Commits(w http.ResponseWriter, r *http.Request) {
|
||||
repo, ok := h.lookupRepo(w, r)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user