File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,21 @@ if [ "${BRANCH_NAME}" = "master" ]; then
1010else
1111 # Make sure there is up-to-date master.
1212 git fetch origin master
13- BRANCH_BASE_SHA=$( git merge-base --fork-point FETCH_HEAD HEAD)
14- echo " Checking changes from $BRANCH_BASE_SHA ..."
15- FLUTTER_CHANGED_GLOBAL=` git diff --name-only $BRANCH_BASE_SHA HEAD | grep -v packages | wc -l`
16- FLUTTER_CHANGED_PACKAGES=` git diff --name-only $BRANCH_BASE_SHA HEAD | grep -o " packages/[^/]*" | sed -e " s/packages\///g" | sort | uniq | paste -s -d, -`
13+
14+ FLUTTER_CHANGED_GLOBAL=0
15+ FLUTTER_CHANGED_PACKAGES=" "
16+
17+ # Try get a merge base for the branch and calculate affected packages.
18+ # We need this check because some CIs can do a single branch clones with a limited history of commits.
19+ if BRANCH_BASE_SHA=$( git merge-base --fork-point FETCH_HEAD HEAD) ; then
20+ echo " Checking changes from $BRANCH_BASE_SHA ..."
21+ FLUTTER_CHANGED_GLOBAL=` git diff --name-only $BRANCH_BASE_SHA HEAD | grep -v packages | wc -l`
22+ FLUTTER_CHANGED_PACKAGES=` git diff --name-only $BRANCH_BASE_SHA HEAD | grep -o " packages/[^/]*" | sed -e " s/packages\///g" | sort | uniq | paste -s -d, -`
23+ else
24+ echo " Cannot find a merge base for the current branch to run an incremental build..."
25+ echo " Please rebase your branch onto the latest master!"
26+ fi
27+
1728 if [ " ${FLUTTER_CHANGED_PACKAGES} " = " " ] || [ $FLUTTER_CHANGED_GLOBAL -gt 0 ]; then
1829 echo " Running for all packages"
1930 pub global run flutter_plugin_tools " $@ "
You can’t perform that action at this time.
0 commit comments