]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cbt.py: use "git --depth 1 for" faster clone 29597/head
authorKefu Chai <kchai@redhat.com>
Mon, 12 Aug 2019 08:50:14 +0000 (16:50 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 12 Aug 2019 08:58:12 +0000 (16:58 +0800)
we don't need the full history for performing the test.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/cbt.py

index e3f35a5b35ba6c64b6af1e991dff46867cd9d2bd..d3a0f0ddd73917789a999aed1457c521d371ce2c 100644 (file)
@@ -179,13 +179,20 @@ class CBT(Task):
         branch = self.config.get('branch', 'master')
         branch = self.config.get('force-branch', branch)
         sha1 = self.config.get('sha1')
-        self.first_mon.run(
-            args=[
-                'git', 'clone', '-b', branch, repo,
-                '{tdir}/cbt'.format(tdir=testdir)
-            ]
-        )
-        if sha1:
+        if sha1 is None:
+            self.first_mon.run(
+                args=[
+                    'git', 'clone', '--depth', '1', '-b', branch, repo,
+                    '{tdir}/cbt'.format(tdir=testdir)
+                ]
+            )
+        else:
+            self.first_mon.run(
+                args=[
+                    'git', 'clone', '-b', branch, repo,
+                    '{tdir}/cbt'.format(tdir=testdir)
+                ]
+            )
             self.first_mon.run(
                 args=[
                     'cd', os.path.join(testdir, 'cbt'), run.Raw('&&'),