Retry on transient failures in git.RunGit.

I've updated git.RunGit to retry on all transient failures, and updated
our list of transient failures with all of the errors we've seen so far.

I've also converted all users of git to use git.RunGit. Since we only
retry on transient failures, it is safe for everyone to use git.RunGit
with retries enabled. If, for some reason, the retries are a problem,
they can be disabled with retry=False.

BUG=chromium:285832, chromium:289932, chromium:294449
TEST=all unit tests
TEST=mario-paladin alex-paladin x86-mario-release --buildbot --debug
TEST=chromiumos-sdk pre-cq-group pre-cq-launcher

Change-Id: I5aa8b3fe0f6f9be2dbd6288f808f9d0c3d64746f
Reviewed-on: https://chromium-review.googlesource.com/170241
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/scripts/loman.py b/scripts/loman.py
index 701aa4c..a440821 100644
--- a/scripts/loman.py
+++ b/scripts/loman.py
@@ -78,9 +78,8 @@
 
   git_config = options.git_config
 
-  enabled_groups = cros_build_lib.RunCommandCaptureOutput(
-      ['git', 'config', '-f', git_config, '--get', 'manifest.groups'],
-      error_code_ok=True, print_cmd=False).output.split(',')
+  cmd = ['config', '-f', git_config, '--get', 'manifest.groups']
+  enabled_groups = git.RunGit('.', cmd, error_code_ok=True).output.split(',')
 
   # Note that ordering actually matters, thus why the following code
   # is written this way.
@@ -100,9 +99,9 @@
       finalized_groups.append(group)
       processed_groups.add(group)
 
-  cros_build_lib.RunCommandCaptureOutput(
-      ['git', 'config', '-f', git_config, 'manifest.groups',
-       ','.join(finalized_groups)], print_cmd=False)
+  cmd = ['config', '-f', git_config, 'manifest.groups',
+         ','.join(finalized_groups)]
+  git.RunGit('.', cmd)
 
 
 def _UpgradeMinilayout(options):