Signed-off-by: George Dunlap <george.dunlap@citrix.com>
return err == nil
}
+func (r Repo) ParseRef(ref string) (string, error) {
+ out, err := r.gitCmd("rev-parse", "--verify", ref)
+ if err != nil {
+ return "", err
+ }
+ lines := strings.Split(string(out), "\n")
+ if len(lines) != 2 {
+ return "", fmt.Errorf("Multiple lines in output")
+ }
+ return lines[0], nil
+}
+
func (r Repo) DeleteBranch(branch string) (out []byte, err error) {
out, err = r.gitCmd("branch", "-D", branch)