Since the main use-case for this work at the moment is self-testing
teuthology, let's make it easy to test the same branch that's being
worked on.
Signed-off-by: Zack Cerza <zack@redhat.com>
#!/bin/bash
-# Clone teuthology
-git clone https://github.com/ceph/teuthology.git
+set -e
+if [ -z "$TEUTHOLOGY_BRANCH" -a -n "$GITHUB_HEAD_REF" ]; then
+ TEUTHOLOGY_BRANCH=${GITHUB_HEAD_REF}
+fi
+git clone \
+ --depth 1 \
+ -b ${TEUTHOLOGY_BRANCH:-$(git branch --show-current)} \
+ https://github.com/ceph/teuthology.git
# Check for .teuthology.yaml file and copy it to teuthology
if [ -f ".teuthology.yaml" ];