func getTreeishId(repo *libgit.Repository, treeish string) string { if branchId, err := repo.GetCommitIdOfBranch(treeish); err == nil { return branchId } if len(treeish) == 40 { return treeish } panic("TODO: Didn't implement getTreeishId") }
func getHeadId(repo *libgit.Repository) (string, error) { if headBranch := getHeadBranch(repo); headBranch != "" { return repo.GetCommitIdOfBranch(getHeadBranch(repo)) } return "", InvalidHead }