From ad497191dfcad3ca439a55e9bf08130c16225ba0 Mon Sep 17 00:00:00 2001 From: Will Boyce Date: Sat, 18 Oct 2014 02:25:23 +0100 Subject: [PATCH] Add `git pull` support --- dokku | 7 +++++++ plugins/git/commands | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dokku b/dokku index 50d2cb62d..a217b5d70 100755 --- a/dokku +++ b/dokku @@ -38,6 +38,13 @@ case "$1" in echo ;; + git-upload-pack) + APP=${2//"'"/} # strip single quotes from the app name: 'app_name' -> app_name + pluginhook pre-pull $APP + cat | git-upload-pack "$DOKKU_ROOT/$APP" + pluginhook post-pull $APP + ;; + build) APP="$2"; IMAGE="dokku/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache" id=$(cat | docker run -i -a stdin $DOKKU_DISTRO /bin/bash -c "mkdir -p /app && tar -xC /app") diff --git a/plugins/git/commands b/plugins/git/commands index 5c9d0ad97..c00f21539 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -6,7 +6,7 @@ git_archive_all() { TMP_WORK_DIR=$(mktemp -d) chmod 755 $TMP_WORK_DIR unset GIT_DIR GIT_WORK_TREE - git clone $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null + git clone -q $DOKKU_ROOT/$APP $TMP_WORK_DIR &> /dev/null pushd $TMP_WORK_DIR > /dev/null git config advice.detachedHead false git checkout $REV &> /dev/null