function _drush_cm_commit_transmitted_configuration_changes

7.x config.drush.inc _drush_cm_commit_transmitted_configuration_changes(&$merge_info)
1 call to _drush_cm_commit_transmitted_configuration_changes()

File

commands/core/config.drush.inc, line 970
Provides Configuration Management commands.

Code

function _drush_cm_commit_transmitted_configuration_changes(&$merge_info) {
  $configuration_path = _drush_cm_get_configuration_path($merge_info);
  // Commit the files brought over via rsync.
  if ($merge_info['commit_needed']) {
    $result = drush_shell_cd_and_exec($configuration_path, 'git add -A .');
    if (!$result) {
      return drush_set_error('DRUSH_CONFIG_MERGE_FAILURE', dt("`git add -A` failed."));
    }
    // Note that this commit will be `merge --squash`-ed away.  We'll put in
    // a descriptive message to help users understand where it came from, if
    // they end up with dirty branches after an aborted run.
    $result = drush_shell_cd_and_exec($configuration_path, 'git commit -m %s', 'Drush config-merge exported configuration from ' . $merge_info['live-site'] . ' ' . $merge_info['message']);
    if (!$result) {
      return drush_set_error('DRUSH_CONFIG_MERGE_FAILURE', dt("`git commit` failed."));
    }
  }
}