summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2019-01-13 19:52:51 +0100
committerAndré Glüpker <git@wgmd.de>2019-01-13 19:52:51 +0100
commitd621d12eb4cce56e21a0be78c4e7b950827250c8 (patch)
treeb093c46a2b0fdaf26887bc74a8699955f8722702
parent20670de7ad7278f8fcd1c40c72af51ab4e7b4511 (diff)
downloadupdate-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.tar.gz
update-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.tar.bz2
update-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.zip
Switch to safe branch, if current branch is merged
-rwxr-xr-xupdateGit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/updateGit.py b/updateGit.py
index 825ef45..de1bbc5 100755
--- a/updateGit.py
+++ b/updateGit.py
@@ -151,13 +151,14 @@ def updatePath(path):
for merged_branch in merged_branches:
if merged_branch in SAFEBRANCHES:
continue
- if merged_branch == cur_branch:
- continue
get_tracking_status = getGitStdout(path, [
'for-each-ref',
'--format=%(upstream:track,nobracket)',
'refs/heads/%s' % merged_branch
])
+ if merged_branch == cur_branch:
+ print("Checking out safe branch, as current is merged.")
+ getGitStdout(path, 'checkout ' + safe_branch)
if get_tracking_status.strip() == 'gone':
print('[%s]' % friendly_path, 'Removing branch by force, upstream is gone.')
print('[%s]' % friendly_path,