aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/repo/http.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 0a211c6f3f..b58d19489b 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -125,10 +125,10 @@ func Http(ctx *middleware.Context, params martini.Params) {
config := Config{base.RepoRootPath, "git", true, true, func(rpc string, input []byte) {
if rpc == "receive-pack" {
- firstLine := bytes.IndexRune(input, '\n')
+ firstLine := bytes.IndexRune(input, '\000')
if firstLine > -1 {
fields := strings.Fields(string(input[:firstLine]))
- if len(fields) > 3 {
+ if len(fields) == 3 {
oldCommitId := fields[0][4:]
newCommitId := fields[1]
refName := fields[2]