Skip to content

Commit

Permalink
Create .git/info dir if it does not exist (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Doiron <57968347+jdoiro3@users.noreply.github.com>
  • Loading branch information
hjoukl and jdoiro3 authored Jan 19, 2023
1 parent 4f78207 commit 2419b8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mkdocs_multirepo_plugin/scripts/sparse_clone_old.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ fi
# sparse checkout the old way
git config core.sparseCheckout true
git remote add -f origin "$url_to_use"
# .git/info might not exist after git init, depending on git version
# (e.g. git 2.24.1 does not create it)
mkdir -p .git/info
for dir in "${dirs[@]}"
do
printf "${dir}\n">> .git/info/sparse-checkout
done
git checkout $branch
rm -rf .git
rm -rf .git

0 comments on commit 2419b8e

Please sign in to comment.