@@ -42,32 +42,25 @@ function clone
42
42
(
43
43
cd " $repo_dir "
44
44
if [ " $PR_TO_TEST " != " 0" ]; then
45
- if git fetch --depth 100 origin " +refs/pull/$PR_TO_TEST /merge" ; then
45
+ if git fetch --depth 1 origin " +refs/pull/$PR_TO_TEST /merge" ; then
46
46
git checkout FETCH_HEAD
47
47
echo " Checked out pull/$PR_TO_TEST /merge ($( git rev-parse FETCH_HEAD) )"
48
48
else
49
- git fetch --depth 100 origin " +refs/pull/$PR_TO_TEST /head"
49
+ git fetch --depth 1 origin " +refs/pull/$PR_TO_TEST /head"
50
50
git checkout " $SHA_TO_TEST "
51
51
echo " Checked out nominal SHA $SHA_TO_TEST for PR $PR_TO_TEST "
52
52
fi
53
53
# Use BASE_BRANCH from environment variable if available, otherwise fall back to master
54
54
if [ -n " $BASE_BRANCH " ]; then
55
55
echo " Using base branch from environment: $BASE_BRANCH "
56
- # Fetch the specific base branch first (without depth limit to allow merge-base)
57
- git fetch origin --depth 100 " $BASE_BRANCH " || {
56
+ # Fetch the specific base branch first
57
+ git fetch --depth 1 origin " +refs/heads/ $BASE_BRANCH :refs/remotes/origin/ $BASE_BRANCH " || {
58
58
echo " ERROR: Could not fetch base branch: $BASE_BRANCH "
59
59
echo " Available remote branches:"
60
60
git branch -r
61
61
exit 1
62
62
}
63
- MERGE_BASE=$( git merge-base HEAD " origin/$BASE_BRANCH " 2> /dev/null || echo " " )
64
- if [ -z " $MERGE_BASE " ]; then
65
- echo " ERROR: No merge base found with base branch: $BASE_BRANCH "
66
- echo " Available remote branches:"
67
- git branch -r
68
- exit 1
69
- fi
70
- git diff --name-only " $MERGE_BASE " HEAD | tee ci-changed-files.txt
63
+ git diff --name-only " origin/$BASE_BRANCH " HEAD | tee ci-changed-files.txt
71
64
else
72
65
echo " No BASE_BRANCH environment variable, using master"
73
66
git diff --name-only master HEAD | tee ci-changed-files.txt
0 commit comments