Skip to content

Commit

Permalink
Add logging during patch-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperg committed Aug 25, 2015
1 parent fb88067 commit ef4c595
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-glue.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
// Download the patch as a temporary file.
$patch = tempnam(sys_get_temp_dir(), 'git-glue-patch');
file_put_contents($patch, file_get_contents($url));
$output->writeln(sprintf('Patch downloaded from %s', $url));

// Determine the directory for the patch if not provided.
if (empty($dir)) {
Expand Down Expand Up @@ -134,13 +135,16 @@
$targetDir = getcwd();
}
$targetRepo = $git->workingCopy($targetDir);
$output->writeln(sprintf('Using repository in %s', realpath($targetRepo->getDirectory())));

if (!empty($workingBranch)) {
// If we have a working branch then lets use that.
$targetRepo->checkout($workingBranch, array('B' => true));
$output->writeln(sprintf('Using branch %s', $workingBranch));
}

// Apply the patch
$output->writeln(sprintf('Applying patch on directory %s', $dir));
$targetRepo->run(array('am', $patch, array('directory' => $dir)));
})->descriptions('Apply a patch which has been created against a previously merged repository.', array(
'url' => 'The url for the patch to apply.',
Expand Down

0 comments on commit ef4c595

Please sign in to comment.