summaryrefslogtreecommitdiff
path: root/branches.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-05 13:05:49 -0500
committerJeff Carr <[email protected]>2025-10-05 13:05:49 -0500
commit6f43c6b2f8e8ef4b19efa43f35f8be8ed7f77fd0 (patch)
treedb3285e03c297f989fa0eb01d6a8ff8e75f74e38 /branches.go
parentb48241106bfadeaae12a8558d8913747881edf4f (diff)
this stuff finally is fixed (maybe)
Diffstat (limited to 'branches.go')
-rw-r--r--branches.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/branches.go b/branches.go
index 7b256bb..b656522 100644
--- a/branches.go
+++ b/branches.go
@@ -107,17 +107,15 @@ func (repo *Repo) MakeLocalDevelBranch() (*cmd.Status, error) {
branch = "devel"
}
- if repo.Exists(filepath.Join(".git/refs/heads", branch)) {
- // local devel branch already exists
+ if repo.IsLocalBranch(branch) {
return nil, nil
}
-
- if repo.Exists(filepath.Join(".git/refs/remotes/origin", branch)) {
- // remote devel branch exists, but local does not
+ if repo.IsRemoteBranch(branch) {
cmd := []string{"git", "checkout", branch}
return repo.RunVerboseOnError(cmd)
}
+ // no local or remote devel branch. make the branch from 'master'
master := repo.GetMasterBranchName()
cmd := []string{"git", "branch", branch, master}
repo.RunVerboseOnError(cmd)