add log
This commit is contained in:
parent
2ec111e1a2
commit
19b7f74b75
14
serve.go
14
serve.go
|
@ -183,14 +183,14 @@ func runServ(k *cli.Context) {
|
||||||
|
|
||||||
rep, err = git.OpenRepository(repoPath)
|
rep, err = git.OpenRepository(repoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("OpenRepository failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
refs, err := rep.AllReferencesMap()
|
refs, err := rep.AllReferencesMap()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("Get All References failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ func runServ(k *cli.Context) {
|
||||||
// for new branch
|
// for new branch
|
||||||
refs, err = rep.AllReferencesMap()
|
refs, err = rep.AllReferencesMap()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("Get All References failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ func runServ(k *cli.Context) {
|
||||||
}
|
}
|
||||||
l, err = ref.AllCommits()
|
l, err = ref.AllCommits()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("Get All Commits failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -267,14 +267,14 @@ func runServ(k *cli.Context) {
|
||||||
//log.Info("00000", ref.Oid.String())
|
//log.Info("00000", ref.Oid.String())
|
||||||
last, err = ref.LastCommit()
|
last, err = ref.LastCommit()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("Get last commit failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ref2, err := rep.LookupReference(ref.Name)
|
ref2, err := rep.LookupReference(ref.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("look up reference failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ func runServ(k *cli.Context) {
|
||||||
//log.Info("11111", ref2.Oid.String())
|
//log.Info("11111", ref2.Oid.String())
|
||||||
before, err := ref2.LastCommit()
|
before, err := ref2.LastCommit()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(err.Error())
|
println("Get last commit failed:", err.Error())
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue