Skip to content

Commit f3cfa5d

Browse files
committed
Make git less verbose #454
1 parent da0a57f commit f3cfa5d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/builder/gitfileset.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import os
2121
import shutil
22+
import logging
2223

2324
from .fileset import FileSet
2425

@@ -36,14 +37,18 @@ def _remove_git_directory(self):
3637

3738
def download(self):
3839
self._remove_git_directory()
39-
cmd = "cd {0} && git clone --depth=1 {1} {2}".format(
40+
cmd = "cd {0} && git clone --quiet --depth=1 {1} {2}".format(
4041
self.temp_dir, self.url, self.git_dir
4142
)
43+
logging.info(f"Git clone '{self.url}'")
4244
os.system(cmd)
4345

4446
# Move it to the root to avoid git default behavior to clone
4547
# into a subdirectory
46-
cmd = "cd {0} && mv {1}/* . && rm -r -f {1}".format(self.temp_dir, self.git_dir)
48+
cmd = "cd {0} && [ -d {1} ] && mv {1}/* {1}/.[!.]* {1}/..?* . 2>/dev/null && rm -rf {1}".format(
49+
self.temp_dir, self.git_dir
50+
)
51+
4752
os.system(cmd)
4853

4954
def do(self):

0 commit comments

Comments
 (0)