From: George Dunlap Date: Wed, 10 May 2017 16:01:14 +0000 (+0100) Subject: git: Add Repo.ResetBranch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ce71903209409a6d6dd4f98d8824633edac4ee66;p=people%2Fgdunlap%2Fxsatool git: Add Repo.ResetBranch To check out a particular branch. This will be used in testing to set up a particular view of the tree. Signed-off-by: George Dunlap --- diff --git a/git.go b/git.go index 0bd2a05..8faa2dd 100644 --- a/git.go +++ b/git.go @@ -112,6 +112,12 @@ func (r Repo) DeleteBranch(branch string) (out []byte, err error) { return } +func (r Repo) ResetBranch(branch string, commit string) (out []byte, err error) { + out, err = r.gitCmd("checkout", "-B", branch, commit) + + return +} + func (r Repo) FormatPatch(path string, baseline string, branch string) (out []byte, err error) { out, err = r.gitCmd("format-patch", "-o"+path, baseline+".."+branch)