8000 CI handle sparse checkout with new branch · scikit-learn/scikit-learn@c40726e · GitHub
[go: up one dir, main page]

Skip to content

Commit c40726e

Browse files
committed
CI handle sparse checkout with new branch
1 parent 96a3e21 commit c40726e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build_tools/circle/push_doc.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,17 @@ if [ ! -d $DOC_REPO ];
3838
then git clone --depth 1 --no-checkout "git@github.com:scikit-learn/"$DOC_REPO".git";
3939
fi
4040
cd $DOC_REPO
41-
git config core.sparseCheckout true
41+
42+
# check if it's a new branch
43+
4244
echo $dir > .git/info/sparse-checkout
45+
if ! git show HEAD:$dir >/dev/null
46+
then
47+
# directory does not exist. Need to make it so sparse checkout works
48+
mkdir $dir
49+
touch $dir/index.html
50+
git add $dir
51+
fi
4352
git checkout master
4453
git reset --hard origin/master
4554
if [ -d $dir ]

0 commit comments

Comments
 (0)
0