#!/bin/bash
#============================================================================#
# Find and clone repo from git.alt                                           #
#============================================================================#
# (C) Denis Smirnov <mithraen@freesource.info>          http://mithraen.ru/  #
#============================================================================#

if [ "$1" = "" ]; then
    echo "Use: $0 <package name>" > /dev/stderr
    exit -1
fi

name=$1
girar-clone-build-commit -o girar "$name" "$name" "$name"
pushd  "$name" || exit -1
git --git-dir=".git" config 'remote.origin.url' "git.alt:packages/$name"
git --git-dir=".git" config 'remote.origin.push' "refs/heads/*:refs/heads/*"
git --git-dir=".git" config 'remote.origin.fetch' "refs/heads/*:refs/remotes/origin/heads/*"

gear-rules-restore-branches
