diff options
| author | Jeff Carr <[email protected]> | 2025-10-05 20:04:38 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-05 20:04:38 -0500 |
| commit | d9ed0838c403e982f572d108542bcc16705049d9 (patch) | |
| tree | 5d8229be3dbfcd068219417cf0039e7e37735eca /branches.go | |
| parent | 7360716b35b452595e93c554d5f342b9f0338ea2 (diff) | |
logic for branch testing
Diffstat (limited to 'branches.go')
| -rw-r--r-- | branches.go | 23 |
1 files changed, 0 insertions, 23 deletions
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) { |
