Skip to content

Commit bec0cbc

Browse files
[3.13] gh-151365: Temporarily downgrade Git to prevent fatal error (GH-155495) (GH-155532) (GH-155533) (#155535)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent a46a67b commit bec0cbc

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/reusable-context.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ jobs:
8686
|| ''
8787
}}
8888
89+
- name: 'Downgrade Git'
90+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
91+
# to avoid "fatal: shallow file has changed since we read it" bug.
92+
# See https://github.com/python/cpython/issues/151365.
93+
if: github.event_name == 'pull_request'
94+
run: |
95+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
96+
git --version
97+
8998
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
9099
- name: Fetch commits to get branch diff
91100
if: github.event_name == 'pull_request'

.github/workflows/reusable-docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ jobs:
4747
&& github.event.pull_request.head.sha
4848
|| ''
4949
}}
50+
- name: 'Downgrade Git'
51+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
52+
# to avoid "fatal: shallow file has changed since we read it" bug.
53+
# See https://github.com/python/cpython/issues/151365.
54+
if: github.event_name == 'pull_request'
55+
run: |
56+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
57+
git --version
5058
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
5159
- name: 'Fetch commits to get branch diff'
5260
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)