ports/opt (3.1): git: make the git driver respect branches
commit f4e4ff757af3fc22d6922a6372ef2c731fa1c3da Author: Thomas Penteker <tek@serverop.de> Date: Mon Jun 22 11:28:34 2015 +0200 git: make the git driver respect branches diff --git a/git/git b/git/git index c06863f..4876e1c 100644 --- a/git/git +++ b/git/git @@ -26,12 +26,12 @@ cd "$PORTS_DIR/$NAME" 2> "/dev/null" if [ $? -lt 1 ]; then git fetch -q - git diff --pretty=format: --name-status $BRANCH origin/$BRANCH | sed "s/M\t/ Edit /g; s/A\t/ Checkout /g; s/D\t/ Delete /g" | sort + git diff --pretty=format: --name-status "$BRANCH" origin/"$BRANCH" | sed "s/M\t/ Edit /g; s/A\t/ Checkout /g; s/D\t/ Delete /g" | sort git clean -q -f - git reset -q --hard origin/$BRANCH + git reset -q --hard origin/"$BRANCH" else echo " Initial git clone, this may take a while" - git clone -q "$URL" "$PORTS_DIR/$NAME" + git clone -q -b "$BRANCH" "$URL" "$PORTS_DIR/$NAME" fi echo "Finished successfully"
participants (1)
-
crux@crux.nu