git hook改为异步

dev_repository_hjq
guange 11 years ago
parent dc29ccf3b7
commit c45850eb8a

@ -94,13 +94,18 @@ class RepositoriesController < ApplicationController
HOOK_TEMPLATE = %Q{#!/bin/sh
exec git update-server-info
CMD_PATH=`dirname $0`
cd $CMD_PATH
PY_PATH=$PWD/../../git_refresh_changes.py
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $(dirname $PWD)
cd -
exec sh -c '
function update()
{
CMD_PATH=`dirname $0`;
cd $CMD_PATH;
PY_PATH=$PWD/../../git_refresh_changes.py;
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $PWD;
cd -;
}
git update-server-info
update
'
}
def create

@ -1,14 +1,18 @@
namespace :git_post_update do
HOOK_TEMPLATE = %Q{#!/bin/sh
exec git update-server-info
CMD_PATH=`dirname $0`
cd $CMD_PATH
PY_PATH=$PWD/../../../git_refresh_changes.py
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $(dirname $PWD)
cd -
exec sh -c '
function update()
{
CMD_PATH=`dirname $0`;
cd $CMD_PATH;
PY_PATH=$PWD/../../git_refresh_changes.py;
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $PWD;
cd -;
}
git update-server-info
update
'
}
desc "update old post-update file, REP_PATH"

Loading…
Cancel
Save