Skip to content

Commit

Permalink
Update git clone
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegal committed Jun 20, 2020
1 parent b9530c3 commit 0bbe8b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/build/git-clone
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/bin/sh

set -e

cd ${_REPOSITORY-.}
BRANCHES=`git branch --list --format="%(refname:lstrip=2)"`

git clone -q $([ -n "$_BRANCH" ] && echo --branch $_BRANCH) \
${_REPOSITORY-.} $__BUILD_DIR/$1 2>${__DEVNULL-/dev/null}

oldpw=`pwd`
cd $__BUILD_DIR/$1
for branch in `git branch --list --format="%(refname:lstrip=2)"`; do
for branch in $BRANCHES; do
echo Copying over $branch from repository.
git branch $branch --track origin/$branch 2>${__DEVNULL-/dev/null} || true
done
cd $oldpw
Expand Down

0 comments on commit 0bbe8b9

Please sign in to comment.