aboutsummaryrefslogtreecommitdiffstats
path: root/serve.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-26 13:21:09 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-26 13:21:09 +0800
commitfc1419d763a5a8266648874bede9a04068c64b87 (patch)
tree667f0f830a32868dc8410fb4b0df4269b8bbe82f /serve.go
parentd374b13d44aeeef9e915c88de7186c92947810e2 (diff)
downloadgitea-fc1419d763a5a8266648874bede9a04068c64b87.tar.gz
gitea-fc1419d763a5a8266648874bede9a04068c64b87.zip
bug fixed
Diffstat (limited to 'serve.go')
-rw-r--r--serve.go37
1 files changed, 19 insertions, 18 deletions
diff --git a/serve.go b/serve.go
index 6cd1e224a8..5a1a67a632 100644
--- a/serve.go
+++ b/serve.go
@@ -5,20 +5,17 @@
package main
import (
- "bytes"
- "container/list"
+ //"container/list"
"fmt"
- "io"
"os"
"os/exec"
"strconv"
"strings"
- "time"
"github.com/codegangsta/cli"
"github.com/gogits/gogs/modules/log"
- "github.com/gogits/git"
+ //"github.com/gogits/git"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
)
@@ -115,11 +112,11 @@ func runServ(k *cli.Context) {
isWrite := In(verb, COMMANDS_WRITE)
isRead := In(verb, COMMANDS_READONLY)
- repo, err := models.GetRepositoryByName(user.Id, repoName)
- var isExist bool = true
+ //repo, err := models.GetRepositoryByName(user.Id, repoName)
+ //var isExist bool = true
if err != nil {
if err == models.ErrRepoNotExist {
- isExist = false
+ //isExist = false
if isRead {
println("Repository", user.Name+"/"+repoName, "is not exist")
return
@@ -168,6 +165,7 @@ func runServ(k *cli.Context) {
return
}
+ /*
var rep *git.Repository
repoPath := models.RepoPath(user.Name, repoName)
if !isExist {
@@ -194,14 +192,20 @@ func runServ(k *cli.Context) {
log.Error(err.Error())
return
}
+*/
+
+ os.Setenv("userName", user.Name)
+ os.Setenv("userId", strconv.Itoa(int(user.Id)))
+ //os.Setenv("repoId", repoId)
+ os.Setenv("repoName", repoName)
gitcmd := exec.Command(verb, rRepo)
gitcmd.Dir = base.RepoRootPath
- var s string
- b := bytes.NewBufferString(s)
+ //var s string
+ //b := bytes.NewBufferString(s)
- gitcmd.Stdout = io.MultiWriter(os.Stdout, b)
+ gitcmd.Stdout = os.Stdout
//gitcmd.Stdin = io.MultiReader(os.Stdin, b)
gitcmd.Stdin = os.Stdin
gitcmd.Stderr = os.Stderr
@@ -213,16 +217,13 @@ func runServ(k *cli.Context) {
}
//if isRead {
- return
+ // return
//}
- time.Sleep(time.Second)
- log.Info(s)
-
// find push reference name
//var t = "ok refs/heads/"
//var i int
- var refname string
+ //var refname string
/*for {
l, err := b.ReadString('\n')
if err != nil {
@@ -237,7 +238,7 @@ func runServ(k *cli.Context) {
}
*/
- refs2, err := rep.AllReferencesMap()
+ /*refs2, err := rep.AllReferencesMap()
for name, ref := range refs2 {
if ref2, ok := refs[name]; ok {
if ref.Oid.Equal(ref2.Oid) {
@@ -323,5 +324,5 @@ func runServ(k *cli.Context) {
if err != nil {
log.Error("update-server-info: %v", err)
}
- }
+ }*/
}