aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-03-29 15:42:41 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-03-29 15:43:04 +0100
commit7f46be3a0d97337e9270e625ab6065b8e3b3805b (patch)
tree6347bba83529445ee110d356341a0d93b51b92e7
parentefa34acc59ffcd88328048174592ba54a80b0acd (diff)
gits: dont ask to push -f to None
-rwxr-xr-xsrc/gits13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gits b/src/gits
index 2dbb011..10e94c0 100755
--- a/src/gits
+++ b/src/gits
@@ -337,12 +337,13 @@ def rebase(git_dir):
git(git_dir, 'rebase', '-i', 'origin/master')
# On conflicts, we'll exit with error implicitly
- do_push = ask(git_dir, 'git push -f to overwrite %r?' % upstream_branch,
- "<empty> don't overwrite upstream",
- 'P `push -f` to overwrite upstream (P in caps!)',
- valid_answers=('', 'P'))
- if do_push == 'P':
- git(git_dir, 'push', '-f')
+ if upstream_branch is not None:
+ do_push = ask(git_dir, 'git push -f to overwrite %r?' % upstream_branch,
+ "<empty> don't overwrite upstream",
+ 'P `push -f` to overwrite upstream (P in caps!)',
+ valid_answers=('', 'P'))
+ if do_push == 'P':
+ git(git_dir, 'push', '-f')
return orig_branch