Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
removing useless whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Jul 2, 2014
1 parent 711347c commit 4016015
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,36 +308,28 @@ func GetTree(w http.ResponseWriter, r *http.Request) {
repo := r.URL.Query().Get(":name")
path := r.URL.Query().Get("path")
ref := r.URL.Query().Get("ref")

if ref == "" {
ref = "master"
}

if path == "" {
path = "."
}

if repo == "" {
err := fmt.Errorf("Error when trying to obtain tree for path %s on ref %s of repository %s (repository is required).", path, ref, repo)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}

tree, err := repository.GetTree(repo, ref, path)

if err != nil {
err := fmt.Errorf("Error when trying to obtain tree for path %s on ref %s of repository %s (%s).", path, ref, repo, err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}

b, err := json.Marshal(tree)

if err != nil {
err := fmt.Errorf("Error when trying to obtain tree for path %s on ref %s of repository %s (%s).", path, ref, repo, err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}

w.Write(b)
}

0 comments on commit 4016015

Please sign in to comment.