Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for custom remote pushurl #143

Merged
merged 3 commits into from Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/land/UberArcanistStackSubmitQueueEngine.php
Expand Up @@ -350,11 +350,8 @@ protected function pushChangeToSubmitQueue() {
pht('PUSHING'),
pht('Pushing changes to Submit Queue.'));
$api = $this->getRepositoryAPI();
list($out) = $api->execxLocal(
'config --get remote.%s.url',
$this->getTargetRemote());
$remoteUrl = $api->uberGetGitRemotePushUrl($this->getTargetRemote());

$remoteUrl = trim($out);
$stack = $this->generateRevisionDiffMappingForLanding();
$statusUrl = $this->submitQueueClient->submitMergeStackRequest(
$remoteUrl,
Expand Down
5 changes: 1 addition & 4 deletions src/land/UberArcanistSubmitQueueEngine.php
Expand Up @@ -94,11 +94,8 @@ protected function pushChangeToSubmitQueue() {
pht('PUSHING'),
pht('Pushing changes to Submit Queue.'));
$api = $this->getRepositoryAPI();
list($out) = $api->execxLocal(
'config --get remote.%s.url',
$this->getTargetRemote());
$remoteUrl = $api->uberGetGitRemotePushUrl($this->getTargetRemote());

$remoteUrl = trim($out);
// Get the latest revision as we could have updated the diff
// as a result of arc diff
$revision = $this->getRevision();
Expand Down
16 changes: 16 additions & 0 deletions src/repository/api/ArcanistGitAPI.php
Expand Up @@ -1606,4 +1606,20 @@ public function uberHasGitSubmodules() {
}
return (bool)strlen(trim($out));
}

/**
* Get the remote push url for a repository
*/
public function uberGetGitRemotePushUrl($remote) {
try {
list($out) = $this->execxLocal(
'config --get remote.%s.pushurl',
$remote);
return trim($out);
} catch (CommandException $ex) {}
list($out) = $this->execxLocal(
'config --get remote.%s.url',
$remote);
return trim($out);
}
}