infra/go: More CrOS assert functions for branch_util test harness
Added several more CrOS-specific assert functions: AssertNoDefaultRevisions,
AssertProjectRevisionsMatchBranch, and AssertManifestProjectRepaired. These
will be used in the next CL.
BUG=chromium:980346
TEST=run_tests.sh
Change-Id: I747b72686c65485bf9e7e0021225c2d2496e0574
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/go/+/1731983
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
Commit-Queue: Jack Neus <jackneus@google.com>
Tested-by: Jack Neus <jackneus@google.com>
diff --git a/internal/git/git.go b/internal/git/git.go
index 0c03d97..990b5a7 100644
--- a/internal/git/git.go
+++ b/internal/git/git.go
@@ -109,6 +109,8 @@
func GetGitRepoRevision(cwd, branch string) (string, error) {
if branch == "" {
branch = "HEAD"
+ } else {
+ branch = NormalizeRef(branch)
}
output, err := RunGit(cwd, []string{"rev-parse", branch})
return strings.TrimSpace(output.Stdout), err