Browse Source

forward "shore bump --force" to "git push"

master
Niklas Rosenstein 5 months ago
parent
commit
31ac79f100
Signed by: NiklasRosenstein <rosensteinniklas@gmail.com> GPG Key ID: 06D269B33D25F6C6
3 changed files with 10 additions and 2 deletions
  1. +6
    -0
      .changelog/_unreleased.yml
  2. +1
    -1
      src/shore/__main__.py
  3. +3
    -1
      src/shore/util/git.py

+ 6
- 0
.changelog/_unreleased.yml View File

@@ -0,0 +1,6 @@
- types:
- change
issues: []
components:
- cli
description: "`shore bump --force --push` now also passes the force option to `git push`."

+ 1
- 1
src/shore/__main__.py View File

@@ -598,7 +598,7 @@ def bump(**args):
_git.tag(tag_name, force=args['force'])

if not args['dry'] and args['push']:
_git.push(_git.current_branch(), tag_name)
_git.push(_git.current_branch(), tag_name, force=args['force'])

if args['publish']:
_cache.clear()


+ 3
- 1
src/shore/util/git.py View File

@@ -51,8 +51,10 @@ def current_branch(path: str = None) -> str:
raise RuntimeError('no curent branch ?')


def push(*refs, remote='origin', path: str = None):
def push(*refs, remote='origin', force: bool = False, path: str = None):
command = ['git', 'push', remote] + list(refs)
if force:
command.insert(2, '-f')
subprocess.check_call(command, cwd=path)




Loading…
Cancel
Save