summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorJosip Sokcevic <sokcevic@chromium.org>2024-10-02 18:05:48 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-10-03 17:40:37 +0000
commitcfe3095e500cef69e312c3b7700d77515070b262 (patch)
tree50b4f1a4b4d47740abc04311bdace9ca16abf511 /project.py
parent621de7ed127f2adb39ed1f0747383ac2afc4d075 (diff)
downloadgit-repo-cfe3095e500cef69e312c3b7700d77515070b262.tar.gz
project: run fetch --refetch on unable to not parse commit
Similarly to e59e2ae757623e64f625a9cdadf1c2010ef82b34, handle missing gc'ed commits by running `git fetch --refetch`. R=jojwang@google.com Bug: b/360889369 Bug: b/371000949 Change-Id: I108b870b855d3b9f23665afa134c6e35f7cd2830 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/438461 Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/project.py b/project.py
index b281863b..b29e604f 100644
--- a/project.py
+++ b/project.py
@@ -2664,7 +2664,10 @@ class Project:
2664 # TODO(b/360889369#comment24): git may gc commits incorrectly. 2664 # TODO(b/360889369#comment24): git may gc commits incorrectly.
2665 # Until the root cause is fixed, retry fetch with --refetch which 2665 # Until the root cause is fixed, retry fetch with --refetch which
2666 # will bring the repository into a good state. 2666 # will bring the repository into a good state.
2667 elif gitcmd.stdout and "could not parse commit" in gitcmd.stdout: 2667 elif gitcmd.stdout and (
2668 "could not parse commit" in gitcmd.stdout
2669 or "unable to parse commit" in gitcmd.stdout
2670 ):
2668 cmd.insert(1, "--refetch") 2671 cmd.insert(1, "--refetch")
2669 print( 2672 print(
2670 "could not parse commit error, retrying with refetch", 2673 "could not parse commit error, retrying with refetch",