Skip to content

Commit

Permalink
clone a specific commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danielepolencic committed Mar 29, 2017
1 parent ec0483f commit de0ce86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"

clone_main_cmd() {
declare desc="creates/updates app from remote git repo"
declare APP="$2" GITURL="$3" TAGNAME="$4"
declare APP="$2" GITURL="$3" TAGNAME="${4:-master}"
local cmd="$1"
local APP_PATH=$DOKKU_ROOT/$APP
local PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"
Expand All @@ -20,9 +20,9 @@ clone_main_cmd() {
git clone "$GITURL" .clone
else
dokku_log_info1 "Creating $APP from $GITURL $TAGNAME"
git clone --depth 1 -n -qq --branch "$TAGNAME" "$GITURL" .clone
git clone -n -qq "$GITURL" .clone
cd .clone
git checkout -qq -b master
git checkout -qq "$TAGNAME"
cd ..
fi
rsync -a "$DOKKU_ROOT/$APP/.clone/.git/" ./
Expand Down

0 comments on commit de0ce86

Please sign in to comment.