#!/bin/sh # # /etc/ports/drivers/git: git driver script for ports(8) # OLDPWD=$PWD if [ $# -ne 1 ] then echo "usage: $0 " exit 1 fi . $1 if [ ! -d $DESTINATION ] then # there was no initial clone git-clone $URL $DESTINATION cd $DESTINATION else # there was already a clone cd $DESTINATION git-fetch git-gc fi git-checkout $BRANCH cd $OLDPWD