pull-repo-ref.sh 371 B

1234567891011121314151617
  1. #! /usr/bin/env bash
  2. REMOTE_REPO=$1
  3. LOCAL_WORKSPACE=$2
  4. REF_REPO=$3
  5. if [ -z $1 -o -z $2 -o -z $3 ]; then
  6. echo "invalid call pull-repo.sh '$1' '$2' '$3'"
  7. elif [ ! -d $LOCAL_WORKSPACE ]; then
  8. git clone --reference $REF_REPO $REMOTE_REPO $LOCAL_WORKSPACE
  9. cd $LOCAL_WORKSPACE
  10. git repack -a
  11. else
  12. cd $LOCAL_WORKSPACE
  13. git fetch --all --tags
  14. cd -
  15. fi