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)
args=[
'git',
'clone',
- '--branch',
- refspec,
git_url,
clonedir,
run.Raw(';'),
'cd', '--', clonedir,
run.Raw('&&'),
+ 'git', 'checkout', refspec,
+ run.Raw('&&'),
'mv', 'qa/workunits', srcdir,
],
)