summaryrefslogtreecommitdiff
path: root/doClean.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-28 17:03:56 -0600
committerJeff Carr <[email protected]>2025-01-28 17:03:56 -0600
commit51ec39d1579c6bd89d6c5c38a1ff2879c37d3d03 (patch)
treeee793a1a3c0e909e200e145a5e8a59587b81ea1a /doClean.go
parent7402aaded7b9f9587eb5ba863b732c9c9e8ee9fe (diff)
cleanup argv handling. go-arg saves the day
Diffstat (limited to 'doClean.go')
-rw-r--r--doClean.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/doClean.go b/doClean.go
index f6efdb5..9955c5c 100644
--- a/doClean.go
+++ b/doClean.go
@@ -62,9 +62,9 @@ func doCleanDevel() error {
// log.Info("Cleaning:", repo.GetGoPath())
}
total += 1
- if repo.GetCurrentBranchName() != repo.GetDevelBranchName() {
- // only process branches in devel
- // return nil
+ if repo.GetCurrentBranchName() != repo.GetMasterBranchName() {
+ // repos must be in the master branch to clean the devel branch
+ return nil
}
if repo.IsDirty() {
return nil
@@ -110,7 +110,9 @@ func checkhashes(repo *gitpb.Repo, hashes []string, refpath string) ([]string, e
func doCleanDevelRepo(repo *gitpb.Repo) error {
var hashes []string
devel := repo.GetDevelBranchName()
- // log.Printf("%s Start verify devel branch: %s\n", repo.GetGoPath(), devel)
+ if argv.Verbose {
+ log.Printf("Start clean devel branch: %s %s\n", repo.GetGoPath(), devel)
+ }
// check if devel branch exists in remote repo
if repo.Exists(filepath.Join(".git/refs/remotes/origin", devel)) {
@@ -451,7 +453,6 @@ func forceDeleteUserBranch(repo *gitpb.Repo, branch string) error {
}
log.Info("THIS USER REMOTE BRANCH MUST BE DELETED HERE", branch)
if repo.Exists(filepath.Join(".git/refs/remote/origin", branch)) {
- // git push origin --delete jcarr
cmd = []string{"git", "push", "origin", "--delete", branch}
if _, err := repo.RunVerbose(cmd); err != nil {
log.Info("THE GIT BRANCH DELETE ERROR IS:", err)
@@ -482,7 +483,6 @@ func BADforceDeleteBranch(repo *gitpb.Repo, branch string) error {
}
log.Info("THIS USER REMOTE BRANCH MUST BE DELETED HERE", branch)
if repo.Exists(filepath.Join(".git/refs/remote/origin", branch)) {
- // git push origin --delete jcarr
cmd = []string{"git", "push", "origin", "--delete", branch}
if _, err := repo.RunVerbose(cmd); err != nil {
log.Info("THE GIT BRANCH DELETE ERROR IS:", err)