e6470338f66757dee66faebc0b143baeaab137bb

Author: gwoo

Date: 2009-01-29 16:28:07 -0800

fixing post recieve hook for new branches

diff --git a/vendors/shells/post_receive.php b/vendors/shells/post_receive.php index 49c8bd3..b46bf4a 100644 --- a/vendors/shells/post_receive.php +++ b/vendors/shells/post_receive.php @@ -44,11 +44,18 @@ class PostReceiveShell extends Shell { if (!isset($refname)) { $refname = 'refs/heads/master'; } - - $commits = $this->Project->Repo->find('all', array( - 'conditions' => array($oldrev . '..' . $newrev), - 'order' => 'asc' - )); + + if ($oldrev == str_pad("0", 40, "0")) { + $commits = $Git->find('all', array( + 'conditions' => array($data['revision']), + 'limit' => 1 + )); + } else { + $commits = $this->Project->Repo->find('all', array( + 'conditions' => array($oldrev . '..' . $newrev), + 'order' => 'asc' + )); + } if (!empty($commits)) {