summaryrefslogtreecommitdiff
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-13 09:53:16 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 14:20:03 +0300
commit25f9da0715500858c62389de76fe9d1e07e3dc3a (patch)
tree34c4fffc60d7cc782fcc49066301a5a87132f396 /gbp/git/repository.py
parentedd12bc8d2bba682ebbae807dfcb428b2d6f4c4e (diff)
downloadgit-buildpackage-25f9da0715500858c62389de76fe9d1e07e3dc3a.tar.gz
git-buildpackage-25f9da0715500858c62389de76fe9d1e07e3dc3a.tar.bz2
git-buildpackage-25f9da0715500858c62389de76fe9d1e07e3dc3a.zip
GitRepository.create_branch: add 'force' option
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index b6456954..760f891e 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -367,16 +367,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)