From b35aa05e77b81e293e4d2491276323b8b62f6ec9 Mon Sep 17 00:00:00 2001
From: Herman van Rink <rink@initfour.nl>
Date: Tue, 8 May 2012 12:25:26 +0200
Subject: [PATCH 1/2] Generalize var name

---
 provision_git.drush.inc |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/provision_git.drush.inc b/provision_git.drush.inc
index e092660..48f17fb 100644
--- a/provision_git.drush.inc
+++ b/provision_git.drush.inc
@@ -41,16 +41,16 @@ function provision_git_drush_command() {
 /**
  * Helper for verifying a repo
  */
-function provision_git_is_repo($site_path = NULL){
-  if (!$site_path){  
-    $site_path = d()->platform->root;
+function provision_git_is_repo($repo_path = NULL){
+  if (!$repo_path){
+    $repo_path = d()->platform->root;
   }
 
   //If shell returns False, this is not a git repo
-  if (!drush_shell_cd_and_exec($site_path, 'git status')){
-    drush_set_error('DRUSH_PROVISION_GIT_PULL_FAILED', dt("Git repository not found in: !path", array('!path' => $site_path)));
+  if (!drush_shell_cd_and_exec($repo_path, 'git status')){
+    drush_set_error('DRUSH_PROVISION_GIT_PULL_FAILED', dt("Git repository not found in: !path", array('!path' => $repo_path)));
   } else {
-    drush_log(dt("Git repository found in !path", array('!path' => $site_path)), 'ok');
+    drush_log(dt("Git repository found in !path", array('!path' => $repo_path)), 'ok');
   }
 }
 
@@ -85,7 +85,7 @@ function drush_provision_pre_provision_git_reset(){
  * Implements the provision-git-pull command.
  */
 function drush_provision_git_pull() {
-  $site_path = d()->platform->root;
+  $repo_path = d()->platform->root;
   $target = d()->platform->name;
   
   //Only git reset --hard if option says so.
@@ -94,20 +94,20 @@ function drush_provision_git_pull() {
   }
   
   //Execute git pull --rebase
-  if (drush_shell_cd_and_exec($site_path, 'git pull --rebase')) {
-    drush_log(dt('Git repository pulled.', array('!path' => $site_path)), 'ok');
+  if (drush_shell_cd_and_exec($repo_path, 'git pull --rebase')) {
+    drush_log(dt('Git repository pulled.', array('!path' => $repo_path)), 'ok');
     drush_log(implode("\n", drush_shell_exec_output()), 'ok');
 
     // Submodule in git? lets update those.
-    if (file_exists($site_path . '/.gitmodules')) {
-      drush_shell_cd_and_exec($site_path, 'git submodule init');
+    if (file_exists($repo_path . '/.gitmodules')) {
+      drush_shell_cd_and_exec($repo_path, 'git submodule init');
       drush_log(implode("\n", drush_shell_exec_output()), 'ok');
-      drush_shell_cd_and_exec($site_path, 'git submodule update');
+      drush_shell_cd_and_exec($repo_path, 'git submodule update');
       drush_log(implode("\n", drush_shell_exec_output()), 'ok');
     }
   }
   else {
-    return drush_set_error('DRUSH_PROVISION_GIT_PULL_FAILED', dt("Git pull failed in !path.\nThe specific errors are below:\n!errors", array('!path' => $site_path, '!errors' => implode("\n", drush_shell_exec_output()))));
+    return drush_set_error('DRUSH_PROVISION_GIT_PULL_FAILED', dt("Git pull failed in !path.\nThe specific errors are below:\n!errors", array('!path' => $repo_path, '!errors' => implode("\n", drush_shell_exec_output()))));
   }
 }
 
-- 
1.7.4.1

