Page MenuHomePhabricator

D7665.id17308.diff
No OneTemporary

D7665.id17308.diff

Index: resources/sql/patches/20131121.repocredentials.2.mig.php
===================================================================
--- resources/sql/patches/20131121.repocredentials.2.mig.php
+++ resources/sql/patches/20131121.repocredentials.2.mig.php
@@ -14,13 +14,13 @@
continue;
}
- $uri = $repository->getRemoteURI();
- if (!$uri) {
+ $raw_uri = $repository->getRemoteURI();
+ if (!$raw_uri) {
echo "...no remote URI.\n";
continue;
}
- $uri = new PhutilURI($uri);
+ $uri = new PhutilURI($raw_uri);
$proto = strtolower($uri->getProtocol());
if ($proto == 'http' || $proto == 'https' || $proto == 'svn') {
@@ -29,6 +29,16 @@
$type = PassphraseCredentialTypePassword::CREDENTIAL_TYPE;
} else {
$username = $repository->getDetail('ssh-login');
+ if (!$username) {
+ // If there's no explicit username, check for one in the URI. This is
+ // possible with older repositories.
+ $username = $uri->getUser();
+ if (!$username) {
+ // Also check for a Git/SCP-style URI.
+ $git_uri = new PhutilGitURI($raw_uri);
+ $username = $git_uri->getUser();
+ }
+ }
$file = $repository->getDetail('ssh-keyfile');
if ($file) {
$secret = $file;

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 20, 5:58 AM (11 h, 40 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6622684
Default Alt Text
D7665.id17308.diff (1 KB)

Event Timeline