function drush_make_resolve_git_revision

master generate.contents.make.inc drush_make_resolve_git_revision($project)

Resolve revision for a git-based project.

1 call to drush_make_resolve_git_revision()
drush_make_resolve_git_refs in commands/make/generate.contents.make.inc
Resolve branches and revisions for git-based projects.

File

commands/make/generate.contents.make.inc, line 216
Functions for the generate makefile command.

Code

function drush_make_resolve_git_revision($project) {
  drush_log(dt('Resolving head commit on `:branch` branch for repo at: :repo', array(':branch' => $project['download']['branch'], ':repo' => $project['download']['url'])));
  if (drush_shell_exec("git ls-remote %s %s", $project['download']['url'], $project['download']['branch'])) {
    $head_output = drush_shell_exec_output();
    list($revision) = explode("\t", $head_output[0]);
    drush_log(dt('Resolved git revision to: :revision', array(':revision' => $revision)));
    return $revision;
  }
  else {
    drush_log(dt('Could not resolve head commit for `:project` using git repo at :repo', array(':project' => $project['name'], ':repo' => $project['download']['url'])), 'warning');
  }
}