summaryrefslogtreecommitdiffstats
path: root/serve.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-26 00:00:36 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-26 00:00:36 +0800
commit9b509054cf8ef8e15cf567614aef46fe12571904 (patch)
tree7ff242e1a253210b851437b5062de6149a4d1b49 /serve.go
parent20ec459b93a68c8bf4b32fafc0532b569f5e1c5e (diff)
downloadgitea-9b509054cf8ef8e15cf567614aef46fe12571904.tar.gz
gitea-9b509054cf8ef8e15cf567614aef46fe12571904.zip
bug fixed
Diffstat (limited to 'serve.go')
-rw-r--r--serve.go22
1 files changed, 17 insertions, 5 deletions
diff --git a/serve.go b/serve.go
index 27324df19b..6cd1e224a8 100644
--- a/serve.go
+++ b/serve.go
@@ -212,18 +212,18 @@ func runServ(k *cli.Context) {
return
}
- if isRead {
+ //if isRead {
return
- }
+ //}
time.Sleep(time.Second)
log.Info(s)
// find push reference name
- var t = "ok refs/heads/"
- var i int
+ //var t = "ok refs/heads/"
+ //var i int
var refname string
- for {
+ /*for {
l, err := b.ReadString('\n')
if err != nil {
break
@@ -235,6 +235,18 @@ func runServ(k *cli.Context) {
refname = l[idx+len(t):]
}
}
+ */
+
+ refs2, err := rep.AllReferencesMap()
+ for name, ref := range refs2 {
+ if ref2, ok := refs[name]; ok {
+ if ref.Oid.Equal(ref2.Oid) {
+ continue
+ }
+ }
+ refname = name
+ break
+ }
if refname == "" {
println("No find any reference name:", s)
return