diff --git a/sites/all/modules/contrib/versioncontrol_git/versioncontrol_git.log.inc b/sites/all/modules/contrib/versioncontrol_git/versioncontrol_git.log.inc
index 6ce018a..0a4db23 100644
--- a/sites/all/modules/contrib/versioncontrol_git/versioncontrol_git.log.inc
+++ b/sites/all/modules/contrib/versioncontrol_git/versioncontrol_git.log.inc
@@ -18,11 +18,6 @@
  *   failed for whatever reason.
  */
 function _versioncontrol_git_log_update_repository(&$repository) {
-  $root = escapeshellcmd($repository['root']);
-  $chdir_ok = @chdir($root); // Set working directory to root.
-  if ($chdir_ok === FALSE) {
-    return FALSE;
-  }
   if ($repository['git_specific']['locked'] == TRUE) {
     drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');
     return FALSE;
@@ -31,7 +26,7 @@ function _versioncontrol_git_log_update_repository(&$repository) {
             SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);
 
   // Get the list of current branches from Git.
-  $branch_list = _versioncontrol_git_log_get_branches();
+  $branch_list = _versioncontrol_git_log_get_branches($repository['root']);
   $add_branch_label = array(
         'name' => '', //filled later
         'type' => VERSIONCONTROL_OPERATION_BRANCH,
@@ -99,7 +94,7 @@ function _versioncontrol_git_log_update_repository(&$repository) {
     _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);
   }
   // Check tags.
-  $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.
+  $tags = _versioncontrol_git_log_get_tags($repository['root']); //Now we have the current list of tags as array of strings.
   $constraints = array(
     'vcs' => array('git'),
     'repo_ids' => array($repository['repo_id']),
@@ -132,11 +127,14 @@ function _versioncontrol_git_log_update_repository(&$repository) {
 
 /**
  * Execute a Git command using the root context and the command to be executed.
- * @param string $command Command to execute.
+ * @param string $root Root of the git repository.
+ * @param string $command Portion of git command to execute without the "git" call itself.
  * @return mixed Logged output from the command in either array of file pointer form.
  */
-function _versioncontrol_git_log_exec($command) {
+function _versioncontrol_git_log_exec($root, $command) {
   $logs = array();
+  $root = escapeshellcmd($root);
+  $command = "git --git-dir=$root " . $command;
   exec($command, $logs);
   array_unshift($logs, '');
   reset($logs); // Reset the array pointer, so that we can use next().
@@ -147,8 +145,8 @@ function _versioncontrol_git_log_exec($command) {
  * Get branches from Git using 'branch -l' command.
  * @return array List of branches.
  */
-function _versioncontrol_git_log_get_branches() {
-  $logs = _versioncontrol_git_log_exec('git show-ref --heads'); // Query branches.
+function _versioncontrol_git_log_get_branches($root) {
+  $logs = _versioncontrol_git_log_exec($root, 'show-ref --heads'); // Query branches.
   $branches = _versioncontrol_git_log_parse_branches($logs); // Parse output.
   return $branches;
 }
@@ -167,9 +165,9 @@ function _versioncontrol_git_log_parse_branches(&$logs) {
 /**
  * Get tags from Git using 'tag -l' command.
  */
-function _versioncontrol_git_log_get_tags() {
+function _versioncontrol_git_log_get_tags($root) {
   //TODO: incorporate a --dereference and parse better, saves one git call for tags
-  $logs = _versioncontrol_git_log_exec('git show-ref --tags'); // Query tags.
+  $logs = _versioncontrol_git_log_exec($root, 'show-ref --tags'); // Query tags.
   $tags = _versioncontrol_git_log_parse_tags($logs); // Parse output.
   return $tags;
 }
@@ -293,10 +291,10 @@ function _versioncontrol_git_get_tag_operations($repository, $tags) {
     $tag_string .= escapeshellarg("refs/tags/$tag") .' ';
   }
   $format = "%(objecttype)\n%(objectname)\n%(refname)\n%(taggername) %(taggeremail)\n%(taggerdate)\n%(contents)\nENDOFGITTAGOUTPUTMESAGEHERE";
-  $exec = "git for-each-ref --format=\"$format\" $tag_string";
-  $logs_tag_msg = _versioncontrol_git_log_exec($exec);
-  $exec = "git show-ref -d $tag_string";
-  $logs_tag_commits = _versioncontrol_git_log_exec($exec);
+  $exec = "for-each-ref --format=\"$format\" $tag_string";
+  $logs_tag_msg = _versioncontrol_git_log_exec($repository['root'], $exec);
+  $exec = "show-ref -d $tag_string";
+  $logs_tag_commits = _versioncontrol_git_log_exec($repository['root'], $exec);
   $tag_commits = array();
   foreach ($logs_tag_commits as $line) {
     if (substr($line, -3, 3) == '^{}') {
@@ -351,8 +349,8 @@ function _versioncontrol_git_process_tags($repository, $new_tags) {
  */
 function _versioncontrol_git_process_commits($repository, $revision, &$branches_per_commit, &$existing_revs) {
   $rev_shell = escapeshellarg($revision);
-  $command = "git log $rev_shell --numstat --summary --pretty=format:\"%H%n%P%n%aN <%ae>%n%ct%n%s%n%b%nENDOFOUTPUTGITMESSAGEHERE\" -n 1 --";
-  $logs = _versioncontrol_git_log_exec($command);
+  $command = "log $rev_shell --numstat --summary --pretty=format:\"%H%n%P%n%aN <%ae>%n%ct%n%s%n%b%nENDOFOUTPUTGITMESSAGEHERE\" -n 1 --";
+  $logs = _versioncontrol_git_log_exec($repository['root'], $command);
   _versioncontrol_git_log_parse_commits($repository, $logs, $branches_per_commit, $existing_revs); // Parse the info from the raw output.
 }
 
@@ -364,7 +362,7 @@ function _versioncontrol_git_process_commits($repository, $revision, &$branches_
  * @return array An array of strings with all commit id's in it
  */
 function _versioncontrol_git_log_get_commits_in_branch($repository, $range) {
-  $logs = _versioncontrol_git_log_exec("git rev-list $range --reverse --"); // Query tags.
+  $logs = _versioncontrol_git_log_exec($repository['root'], "rev-list $range --reverse --"); // Query tags.
   $commits = array();
   while (($line = next($logs)) !== FALSE) {
     $commits[] = trim($line);
@@ -416,8 +414,8 @@ function _versioncontrol_git_get_source_item($repository, $filename, $parents, $
       $filenameg = substr($filename, 1);
       $filenameg = escapeshellarg($filenameg);
       $commit_rev = escapeshellarg($commit_rev);
-      $exec = "git rev-list -n 1 ". $commit_rev ."^ -- $filenameg";
-      $logs = _versioncontrol_git_log_exec($exec); // Query tags.
+      $exec = "rev-list -n 1 ". $commit_rev ."^ -- $filenameg";
+      $logs = _versioncontrol_git_log_exec($repository['root'], $exec); // Query tags.
       $revision = next($logs);
       $ret = array(
         array(
@@ -557,7 +555,6 @@ function _versioncontrol_git_log_parse_commits($repository, &$logs, &$branches_p
   // If the log was retrieved by taking the return value of exec(), we've
   // got an array and navigate it via next(). If we stored the log in a
   // temporary file, $logs is a file handle that we need to fgets() instead.
-  $root_path = $repository['root'];
   $line = next($logs); // Get Revision
   $merge = FALSE;
   // $line already points to the revision
