From 25f9da0715500858c62389de76fe9d1e07e3dc3a Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 13 Sep 2013 09:53:16 +0300 Subject: GitRepository.create_branch: add 'force' option Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gbp/git/repository.py') 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) -- cgit v1.2.3