diff options
author | André Glüpker <git@wgmd.de> | 2019-01-13 19:52:51 +0100 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2019-01-13 19:52:51 +0100 |
commit | d621d12eb4cce56e21a0be78c4e7b950827250c8 (patch) | |
tree | b093c46a2b0fdaf26887bc74a8699955f8722702 | |
parent | 20670de7ad7278f8fcd1c40c72af51ab4e7b4511 (diff) | |
download | update-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.tar.gz update-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.tar.bz2 update-git-d621d12eb4cce56e21a0be78c4e7b950827250c8.zip |
Switch to safe branch, if current branch is merged
-rwxr-xr-x | updateGit.py | 5 |
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, |