check for HEAD before cloning
This commit is contained in:
parent
d3245f864f
commit
d11b585ecb
@ -23,10 +23,13 @@ git submodule foreach git fetch origin
|
|||||||
git submodule foreach git reset --hard origin/master > /dev/null 2>&1
|
git submodule foreach git reset --hard origin/master > /dev/null 2>&1
|
||||||
|
|
||||||
for remote in $(ssh git@subgit.ugent.be task students -l "$task" | cut -f4); do
|
for remote in $(ssh git@subgit.ugent.be task students -l "$task" | cut -f4); do
|
||||||
if [ -d "$(basename "$remote")" ]; then
|
if [ -d "$(basename "$remote")" ]; then continue; fi # exists
|
||||||
true # exists
|
remotes="$(git ls-remote "$remote")"
|
||||||
elif [ -z "$(git ls-remote "$remote")" ]; then
|
if ! echo "$remotes" | grep -q HEAD; then
|
||||||
echo "No branches at $remote"
|
printf 'No HEAD at %s' "$remote"
|
||||||
|
count="$(echo "$remotes" | grep -o refs/heads | wc -l)"
|
||||||
|
if [ "$count" -gt 0 ]; then printf ' (but %d other)' "$count"; fi
|
||||||
|
printf '\n'
|
||||||
else
|
else
|
||||||
echo "adding $remote"
|
echo "adding $remote"
|
||||||
git submodule --quiet add --force "$remote" || true
|
git submodule --quiet add --force "$remote" || true
|
||||||
|
Loading…
Reference in New Issue
Block a user