Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F85984
D7665.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7665.diff
View Options
diff --git a/resources/sql/patches/20131121.repocredentials.2.mig.php b/resources/sql/patches/20131121.repocredentials.2.mig.php
--- a/resources/sql/patches/20131121.repocredentials.2.mig.php
+++ b/resources/sql/patches/20131121.repocredentials.2.mig.php
@@ -14,21 +14,31 @@
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') {
$username = $repository->getDetail('http-login');
$secret = $repository->getDetail('http-pass');
$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
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/ye/ja/cdgj5vb3l4pley3c
Default Alt Text
D7665.diff (1 KB)
Attached To
Mode
D7665: Fix an issue with repository credential migration for older repositories
Attached
Detach File
Event Timeline
Log In to Comment