Skip to content

Commit 9efb798

Browse files
committed
Unshallow to find merge-base
1 parent b12ef37 commit 9efb798

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ci-image/scripts/ga-typecheck.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ source virtualenv/bin/activate
1212
uv pip install pyright
1313

1414
cd src/${GITHUB_REPOSITORY##*/}
15+
git fetch --unshallow || true
16+
git fetch origin master:master || true
1517
HEAD_REV="$(git rev-parse HEAD)"
1618
if [[ $GITHUB_REF == "master" ]]; then
1719
BASE_REV="$(git rev-parse --abbrev-ref HEAD~)"
1820
else
19-
git fetch origin master:master || true
2021
BASE_REV="$(git rev-parse --abbrev-ref master)"
2122
fi
2223

ci-image/scripts/lint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ def compare_lint():
4545
repo_name = os.path.basename(repo_dir)
4646

4747
os.chdir(repo_dir)
48+
subprocess.call("git fetch --unshallow".split())
49+
subprocess.call("git fetch origin master".split())
4850
cur_branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD".split()).decode().strip()
4951
if cur_branch == "master":
5052
compare_ref = 'HEAD^'
5153
else:
52-
subprocess.call("git fetch origin master".split())
5354
compare_ref = subprocess.check_output("git merge-base origin/master {}".format(cur_branch).split()).decode()
5455

5556
# get the files to lint

0 commit comments

Comments
 (0)