]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
workunit: git checkout sha1/branch/tag
authorLoic Dachary <ldachary@redhat.com>
Wed, 16 Mar 2016 08:05:46 +0000 (09:05 +0100)
committerNathan Cutler <ncutler@suse.com>
Sat, 19 Mar 2016 12:06:22 +0000 (13:06 +0100)
git clone --branch refspec only accepts branches and tags but not a sha1
git reset --hard refspec only accepts tags and sha1 but not branches

Use git checkout because it interprets branches, tags and sha1 as
expected.

$ git checkout jewel
Branch jewel set up to track remote branch jewel from origin.
Switched to a new branch 'jewel'
$ git checkout v0.94.6
HEAD is now at e832001... 0.94.6
$ git checkout b2503b0e15c0b13f480f0835060479717b9cf935
HEAD is now at 95cefea... 0.94.3

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit d1f456850c6297ca3fbb3ec0daddfddafdeff784)

tasks/workunit.py

index 2b1d4130b5e00ce0da9d241539c5011ae172f1b1..86bcdb5b9f6456e73c59d1f338328cdbb784e95b 100644 (file)
@@ -314,13 +314,13 @@ def _run_tests(ctx, refspec, role, tests, env, subdir=None, timeout=None):
             args=[
                 'git',
                 'clone',
-                '--branch',
-                refspec,
                 git_url,
                 clonedir,
                 run.Raw(';'),
                 'cd', '--', clonedir,
                 run.Raw('&&'),
+                'git', 'checkout', refspec,
+                run.Raw('&&'),
                 'mv', 'qa/workunits', srcdir,
             ],
         )