From: Markus Lehtonen Date: Fri, 13 Sep 2013 06:53:16 +0000 (+0300) Subject: GitRepository.create_branch: add 'force' option X-Git-Tag: debian/0.6.23~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=410e613ac2c72e94a9e45ddd1ed3670a5ef1cf7c;p=tools%2Fgit-buildpackage.git GitRepository.create_branch: add 'force' option Signed-off-by: Markus Lehtonen --- diff --git a/gbp/git/repository.py b/gbp/git/repository.py index edb8e21f..96921b1a 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)