Run cleanup commands from inside the git store.

In cases where the checkout directory is missing, running any commands
from under there will produce errors. In this case, the git command
does not need to touch the checkout directory at all -- it should be
running from under the git store.

This fixes a breakage introduced by CL:169925

BUG=chromium:206946
TEST=Run a tryjob on a builder that had a missing checkout directory

Change-Id: I4bd3a8e43905ecdda9f05fdff2e4203cf4da3844
Reviewed-on: https://chromium-review.googlesource.com/173033
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/buildbot/cbuildbot_commands.py b/buildbot/cbuildbot_commands.py
index b3de9f6..5640783 100644
--- a/buildbot/cbuildbot_commands.py
+++ b/buildbot/cbuildbot_commands.py
@@ -180,8 +180,8 @@
       else:
         # Delete all branches created by cbuildbot.
         if os.path.isdir(repo_git_store):
-          git.RunGit(cwd, ['--git-dir', repo_git_store, 'branch', '-D'] +
-                          list(constants.CREATED_BRANCHES), error_code_ok=True)
+          cmd = ['branch', '-D'] + list(constants.CREATED_BRANCHES)
+          git.RunGit(repo_git_store, cmd, error_code_ok=True)
 
   # Cleanup all of the directories.
   dirs = [[attrs['name'], os.path.join(buildroot, attrs['path'])] for attrs in