Commit 0a5bd0fe authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use blob IDs, not commit IDs

parent 16dc2cea
...@@ -2,7 +2,6 @@ package git ...@@ -2,7 +2,6 @@ package git
import ( import (
"../helper" "../helper"
"encoding/base64"
"fmt" "fmt"
"io" "io"
"log" "log"
...@@ -10,14 +9,9 @@ import ( ...@@ -10,14 +9,9 @@ import (
) )
func SendGitBlob(w http.ResponseWriter, r *http.Request, repoPath string, blobId string) { func SendGitBlob(w http.ResponseWriter, r *http.Request, repoPath string, blobId string) {
blobSpec, err := base64.URLEncoding.DecodeString(blobId) log.Printf("SendGitBlob: sending %q for %q", blobId, r.URL.Path)
if err != nil {
helper.Fail500(w, fmt.Errorf("SendGitBlob: decode commit id + path: %v", err))
return
}
log.Printf("SendGitBlob: sending %q for %q", blobSpec, r.URL.Path)
gitShowCmd := gitCommand("", "git", "--git-dir="+repoPath, "show", string(blobSpec)) gitShowCmd := gitCommand("", "git", "--git-dir="+repoPath, "show", blobId)
stdout, err := gitShowCmd.StdoutPipe() stdout, err := gitShowCmd.StdoutPipe()
if err != nil { if err != nil {
helper.Fail500(w, fmt.Errorf("SendGitBlob: git show stdout: %v", err)) helper.Fail500(w, fmt.Errorf("SendGitBlob: git show stdout: %v", err))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment