branch_util: make tool fast (and correct)!

A few improvements here. Some for performance, some for correctness:
- Perform shallower checkouts (usually either a single branch, --depth=1, or both). This
is more important for larger repos (like chromite).
- Added retries on certain git operations. Actual runs of the tool were failing due
to http flakes.
- Fixed some logic with repairing manifests caused by corner cases in actual manifests
that weren't represented in tests.
- Created worker pools for branch validation and branch creation. This sped things up a lot.

BUG=chromium:980346,chromium:986454
TEST=run_tests.sh and manual dry runs

Change-Id: I1032cb4a45d883da188d026f015a1da58308cea0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/go/+/1754909
Tested-by: Jack Neus <jackneus@google.com>
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Evan Hernandez <evanhernandez@chromium.org>
Commit-Queue: Jack Neus <jackneus@google.com>
diff --git a/internal/git/git_test.go b/internal/git/git_test.go
index 0a01b09..5604ed1 100644
--- a/internal/git/git_test.go
+++ b/internal/git/git_test.go
@@ -58,6 +58,11 @@
 	assert.Equal(t, NormalizeRef("foo"), "refs/heads/foo")
 }
 
+func TestIsSHA(t *testing.T) {
+	assert.Assert(t, IsSHA("4f4fad584e9c2735af5131f15b697376a3327de5"))
+	assert.Assert(t, !IsSHA("refs/heads/master"))
+}
+
 func TestGetCurrentBranch_success(t *testing.T) {
 	fakeGitRepo := "top-secret-project"
 	fakeGitData := "refs/heads/current-branch"