Skip to content

Commit af5a056

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

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
@@ -66,6 +66,15 @@ jobs:
6666
|| ''
6767
}}
6868
69+
- name: 'Downgrade Git'
70+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
71+
# to avoid "fatal: shallow file has changed since we read it" bug.
72+
# See https://github.com/python/cpython/issues/151365.
73+
if: github.event_name == 'pull_request'
74+
run: |
75+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
76+
git --version
77+
6978
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
7079
- name: Fetch commits to get branch diff
7180
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
@@ -33,6 +33,14 @@ jobs:
3333
&& github.event.pull_request.head.sha
3434
|| ''
3535
}}
36+
- name: 'Downgrade Git'
37+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
38+
# to avoid "fatal: shallow file has changed since we read it" bug.
39+
# See https://github.com/python/cpython/issues/151365.
40+
if: github.event_name == 'pull_request'
41+
run: |
42+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
43+
git --version
3644
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
3745
- name: 'Fetch commits to get branch diff'
3846
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)