diff --git a/iq.drush.inc b/iq.drush.inc index 3bb39683630e6f07ebbd5a3e2ea07dec0152d18e..4c7acbd24a3459b3bc0f4f16a0fbbcb149c4e39c 100644 --- a/iq.drush.inc +++ b/iq.drush.inc @@ -565,23 +565,23 @@ function drush_iq_apply_patch($number) { } } $result = drush_shell_exec_interactive('patch -Np%d --batch -d %s -i %s', $strip_count, $project_dir, $filename); - if (!drush_get_option('no-commit', FALSE)) { - $commit_comment = _drush_iq_create_commit_comment($issue_info, drush_get_option('committer', FALSE), drush_get_option('message', FALSE)); - // TODO: can we easily ignore *.patch, etc., or easily add only modified files? - $result = drush_shell_exec("git add ."); - if (dirname($filename) == $project_dir) { - $result = drush_shell_exec("git rm --cached -- %s", basename($filename)); - if ($keep_patch) { - $result = drush_shell_exec("git rm --cached -- %s", basename($keep_patch)); - } - } - if (array_key_exists('patchAuthorCredit', $issue_info)) { - $result = drush_shell_exec("git commit --author=%s -m %s", $issue_info['patchAuthorCredit'], $commit_comment); - } - else { - $result = drush_shell_exec("git commit -m %s", $commit_comment); + } + if (!drush_get_option('no-commit', FALSE)) { + $commit_comment = _drush_iq_create_commit_comment($issue_info, drush_get_option('committer', FALSE), drush_get_option('message', FALSE)); + // Add the modified files + $result = drush_shell_exec("git add -A"); + if (dirname($filename) == $project_dir) { + $result = drush_shell_exec("git rm --cached -- %s", basename($filename)); + if ($keep_patch) { + $result = drush_shell_exec("git rm --cached -- %s", basename($keep_patch)); } } + if (array_key_exists('patchAuthorCredit', $issue_info)) { + $result = drush_shell_exec("git commit --author=%s -m %s", $issue_info['patchAuthorCredit'], $commit_comment); + } + else { + $result = drush_shell_exec("git commit -m %s", $commit_comment); + } } drush_op('chdir', $cwd); return $issue_info; @@ -913,11 +913,8 @@ function _drush_iq_project_dir(&$issue_info) { if (array_key_exists($project_name, $extension_info)) { $result = drush_get_context('DRUSH_DRUPAL_ROOT', '') . '/' . dirname($extension_info[$project_name]->filename); } - else { - drush_log(dt('Could not find the project directory under the bootstrapped site')); - } } - elseif ($phase >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) { + if ($phase >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) { $root = drush_get_context('DRUSH_DRUPAL_ROOT', FALSE); if ($root) { if ($project_name == 'drupal') { @@ -937,6 +934,9 @@ function _drush_iq_project_dir(&$issue_info) { if ($result) { $issue_info['project-dir'] = $result; } + else { + drush_log(dt('Could not find the project directory under the bootstrapped site')); + } } return $result;