From 8abef63f217e2382810e1a8cc8ccf80cee32d17a Mon Sep 17 00:00:00 2001
From: Robert K <robertk@posteo.org>
Date: Sun, 17 Oct 2021 13:14:04 +0200
Subject: [PATCH] [bugfix][Python] fix problem with sparse checkout when
 downloading the tutorial.

---
 python/dune/femdg/__main__.py | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/python/dune/femdg/__main__.py b/python/dune/femdg/__main__.py
index 9a6ef168..55c905a8 100644
--- a/python/dune/femdg/__main__.py
+++ b/python/dune/femdg/__main__.py
@@ -3,17 +3,15 @@ commands='''
 mkdir femdg_tutorial
 cd femdg_tutorial
 
-mkdir tmp
-cd tmp
-git init
-git remote add origin https://gitlab.dune-project.org/dune-fem/dune-fem-dg.git
-git config core.sparsecheckout true
-echo 'pydemo/' > .git/info/sparse-checkout
-echo 'doc/'  >> .git/info/sparse-checkout
-git pull origin master
+TMPNAME=`mktemp -d -p ./`
+
+# clone repo without history
+git clone --depth 1 https://gitlab.dune-project.org/dune-fem/dune-fem-dg.git $TMPNAME
+cd $TMPNAME
+
 cp pydemo/camc-paper/*.py pydemo/camc-paper/*.hh pydemo/camc-paper/*.dgf ..
 cd ..
-rm -rf tmp
+rm -rf $TMPNAME
 '''
 subprocess.check_output(commands, shell=True)
 
-- 
GitLab