Skip to content

Commit cfe3095

Browse files
sokcevicGLUCI
authored andcommitted
project: run fetch --refetch on unable to not parse commit
Similarly to e59e2ae, handle missing gc'ed commits by running `git fetch --refetch`. [email protected] Bug: b/360889369 Bug: b/371000949 Change-Id: I108b870b855d3b9f23665afa134c6e35f7cd2830 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/438461 Reviewed-by: Joanna Wang <[email protected]> Tested-by: Josip Sokcevic <[email protected]> Commit-Queue: Josip Sokcevic <[email protected]>
1 parent 621de7e commit cfe3095

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2664,7 +2664,10 @@ def _RemoteFetch(
26642664
# TODO(b/360889369#comment24): git may gc commits incorrectly.
26652665
# Until the root cause is fixed, retry fetch with --refetch which
26662666
# 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+
):
26682671
cmd.insert(1, "--refetch")
26692672
print(
26702673
"could not parse commit error, retrying with refetch",

0 commit comments

Comments
 (0)