Skip to content
Snippets Groups Projects

Handle "git archive" via headers

Merged username-removed-5302 requested to merge archive-header into master
5 files
+ 56
38
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 6
3
@@ -6,6 +6,7 @@ package git
import (
"../helper"
"../senddata"
"fmt"
"io"
"io/ioutil"
@@ -19,16 +20,18 @@ import (
"time"
)
const SendArchivePrefix = "git-archive:"
type archive struct{ senddata.Prefix }
func SendArchive(w http.ResponseWriter, r *http.Request, sendData string) {
var SendArchive = &archive{"git-archive:"}
func (a *archive) Handle(w http.ResponseWriter, r *http.Request, sendData string) {
var params struct {
RepoPath string
ArchivePath string
ArchivePrefix string
CommitId string
}
if err := unpackSendData(&params, sendData, SendArchivePrefix); err != nil {
if err := a.Unpack(&params, sendData); err != nil {
helper.Fail500(w, fmt.Errorf("SendArchive: unpack sendData: %v", err))
return
}
Loading