summaryrefslogtreecommitdiff
path: root/compare.go
diff options
context:
space:
mode:
Diffstat (limited to 'compare.go')
-rw-r--r--compare.go28
1 files changed, 18 insertions, 10 deletions
diff --git a/compare.go b/compare.go
index ed362f7..c0452eb 100644
--- a/compare.go
+++ b/compare.go
@@ -2,8 +2,6 @@ package gitpb
import (
"fmt"
-
- "go.wit.com/log"
)
type RepoTag struct {
@@ -32,25 +30,34 @@ func (r *Repo) NewCompareRef(t *GitTag) *RepoTag {
return rt
}
-func (t1 *RepoTag) DeleteBranch(t2 *RepoTag) ([]string, []string, error) {
- lines1, err1 := t1.r.CountDiffObjectsNew(t1.t.Refname, t2.t.Refname)
+func (rt *RepoTag) GetRefname() string {
+ return rt.t.Refname
+}
+
+func (rt *RepoTag) GetRef() *GitTag {
+ return rt.t
+}
+
+func (t1 *RepoTag) DeleteBranch(t2 *RepoTag) ([]string, []string, []string, []string, error) {
+ lines1, cmd1, err1 := t1.r.CountDiffObjectsNEWNEW(t1.t.Refname, t2.t.Refname)
// log.Info("lessthan", t1.t.Refname, t2.t.Refname, count, t1.r.FullPath)
if err1 != nil {
// log.Info("lessthan", t1.t.Refname, t2.t.Refname, count, t1.r.FullPath, err)
- return nil, nil, err1
+ return nil, nil, cmd1, nil, err1
}
- lines2, err2 := t1.r.CountDiffObjectsNew(t2.t.Refname, t1.t.Refname)
+ lines2, cmd2, err2 := t1.r.CountDiffObjectsNEWNEW(t2.t.Refname, t1.t.Refname)
// log.Info("lessthan", t1.t.Refname, t2.t.Refname, count, t1.r.FullPath)
if err2 != nil {
// log.Info("lessthan", t1.t.Refname, t2.t.Refname, count, t1.r.FullPath, err)
- return nil, nil, err2
+ return nil, nil, cmd1, cmd2, err2
}
if (len(lines1) != 0) || (len(lines2) != 0) {
- return lines1, lines2, fmt.Errorf("nope")
+ return lines1, lines2, cmd1, cmd2, fmt.Errorf("nope")
}
- return lines1, lines2, nil
+ return lines1, lines2, cmd1, cmd2, nil
}
+/*
func (t1 *RepoTag) LessThanVerbose(t2 *RepoTag) []string {
count, err := t1.r.CountDiffObjectsNew(t1.t.Refname, t2.t.Refname)
log.Info("lessthan", t1.t.Refname, t2.t.Refname, len(count), t1.r.FullPath)
@@ -67,10 +74,11 @@ func (t1 *RepoTag) LessThanVerbose(t2 *RepoTag) []string {
func (t1 *RepoTag) Equal(t2 *RepoTag) bool {
return false
}
+*/
// if t1 is user branch, and t2 is devel branch, true if 0
func (t1 *RepoTag) GreaterThan(t2 *RepoTag) []string {
- lines, err := t1.r.CountDiffObjectsNew(t2.t.Refname, t1.t.Refname)
+ lines, _, err := t1.r.CountDiffObjectsNEWNEW(t2.t.Refname, t1.t.Refname)
// log.Info("greaterthan", t1.t.Refname, t2.t.Refname, count, t1.r.FullPath, err)
if err != nil {
return nil