File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2659,6 +2659,17 @@ def _RemoteFetch(
2659
2659
# Fallthru to sleep+retry logic at the bottom.
2660
2660
pass
2661
2661
2662
+ # TODO(b/360889369#comment24): git may gc commits incorrectly.
2663
+ # Until the root cause is fixed, retry fetch with --refetch which
2664
+ # will bring the repository into a good state.
2665
+ elif gitcmd .stdout and "could not parse commit" in gitcmd .stdout :
2666
+ cmd .insert (1 , "--refetch" )
2667
+ print (
2668
+ "could not parse commit error, retrying with refetch" ,
2669
+ file = output_redir ,
2670
+ )
2671
+ continue
2672
+
2662
2673
# Try to prune remote branches once in case there are conflicts.
2663
2674
# For example, if the remote had refs/heads/upstream, but deleted
2664
2675
# that and now has refs/heads/upstream/foo.
You can’t perform that action at this time.
0 commit comments