diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-09-13 09:53:16 +0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-12-05 15:35:53 +0100 |
commit | 410e613ac2c72e94a9e45ddd1ed3670a5ef1cf7c (patch) | |
tree | 2c5c949464bdbbf66f09e22b925e4aa0afb76e4c /gbp | |
parent | cb9271fe113bae56088c9c1d07870c408a518a52 (diff) |
GitRepository.create_branch: add 'force' option
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index edb8e21..96921b1 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -295,16 +295,18 @@ class GitRepository(object): args = GitArgs("-m", branch, newbranch) self._git_command("branch", args.args) - def create_branch(self, branch, rev=None): + def create_branch(self, branch, rev=None, force=False): """ Create a new branch @param branch: the branch's name @param rev: where to start the branch from + @param force: reset branch HEAD to start point, if it already exists If rev is None the branch starts form the current HEAD. """ args = GitArgs(branch) + args.add_true(force, '--force') args.add_true(rev, rev) self._git_command("branch", args.args) |