From d9ed0838c403e982f572d108542bcc16705049d9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 5 Oct 2025 20:04:38 -0500 Subject: logic for branch testing --- branches.go | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'branches.go') diff --git a/branches.go b/branches.go index b656522..c717db9 100644 --- a/branches.go +++ b/branches.go @@ -2,7 +2,6 @@ package gitpb import ( "errors" - "fmt" "os" "path/filepath" "strings" @@ -76,28 +75,6 @@ func (repo *Repo) GetBranchDifferences(to string, from string) []string { return result.Stdout } -// deletes the devel local branch if it is a subset of the remote devel branch -func (repo *Repo) DeleteLocalDevelBranch() error { - branch := repo.GetDevelBranchName() - remote := filepath.Join("origin", branch) - - if !repo.IsDevelRemote() { - return fmt.Errorf("no remote branch") - } - - b1, err := repo.CountDiffObjects(branch, remote) // should be zero - if err != nil { - return err - } - if b1 == 0 { - cmd := []string{"git", "branch", "-D", repo.GetDevelBranchName()} - _, err := repo.RunVerboseOnError(cmd) - return err - } else { - return fmt.Errorf("local branch has patches not in remote") - } -} - // makes a local branch based off of the master branch // (unless a remote devel branch exists. then it uses that) func (repo *Repo) MakeLocalDevelBranch() (*cmd.Status, error) { -- cgit v1.2.3