Skip to content

Commit

Permalink
Merge eff99b5 into 53e1145
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Apr 26, 2019
2 parents 53e1145 + eff99b5 commit e83d1e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public function run()
} else {
$this->preparePrClient();
$this->client->forceUpdateBranch($branch_name, $default_base);
$this->client->commitNewFiles($this->tmpDir, $default_base, $branch_name, sprintf("Update %s", $package_name));
$this->client->commitNewFiles($this->tmpDir, $default_base, $branch_name, sprintf("Update %s", $package_name), $lock_file_contents);
}
$this->log('Trying to retrieve changelog for ' . $package_name);
$changelog = null;
Expand Down Expand Up @@ -946,6 +946,9 @@ public function run()
$this->execCommand('git checkout ' . $default_branch, false);
// Re-do composer install to make output better, and to make the lock file actually be there for
// consecutive updates, if it is a project without it.
if (!$lock_file_contents) {
$this->execCommand('rm composer.lock');
}
$this->doComposerInstall();
}
// Clean up.
Expand Down
6 changes: 4 additions & 2 deletions src/Providers/PublicGithubWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ protected function createPullRequestRequest($user_name, $user_repo, $params, $pa
return $request;
}

public function commitNewFiles($tmp_dir, $sha, $branch, $message)
public function commitNewFiles($tmp_dir, $sha, $branch, $message, $lock_file_contents)
{
// Get the contents of all composer related files.
$files = [
'composer.lock',
'composer.json',
];
if ($lock_file_contents) {
$files[] = 'composer.lock';
}
$files_with_contents = [];
foreach ($files as $file) {
$filename = "$tmp_dir/$file";
Expand Down

0 comments on commit e83d1e8

Please sign in to comment.