Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15401895
D14420.id34836.diff
No One
Temporary
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
D14420.id34836.diff
View Options
diff --git a/src/land/ArcanistGitLandEngine.php b/src/land/ArcanistGitLandEngine.php
--- a/src/land/ArcanistGitLandEngine.php
+++ b/src/land/ArcanistGitLandEngine.php
@@ -262,13 +262,26 @@
$path->removeUpstream($local_branch);
if (!$path->getLength()) {
- $this->writeInfo(
- pht('UPDATE'),
- pht(
- 'Local branch "%s" directly tracks remote, staying on '.
- 'detached HEAD.',
- $local_branch));
- return;
+ // The local branch tracked upstream directly; however, it
+ // may not be the only one to do so. If there's a local
+ // branch of the same name that tracks the remote, try
+ // switching to that.
+ $local_branch = $this->getTargetOnto();
+ list($err) = $api->execManualLocal(
+ 'rev-parse --verify %s',
+ $local_branch);
+ if (!$err) {
+ $path = $api->getPathToUpstream($local_branch);
+ }
+ if (!$path->isConnectedToRemote()) {
+ $this->writeInfo(
+ pht('UPDATE'),
+ pht(
+ 'Local branch "%s" directly tracks remote, staying on '.
+ 'detached HEAD.',
+ $local_branch));
+ return;
+ }
}
$local_branch = head($path->getLocalBranches());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 7:41 PM (3 d, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710302
Default Alt Text
D14420.id34836.diff (1 KB)
Attached To
Mode
D14420: Try switching to the branch of the same name, instead of detached head
Attached
Detach File
Event Timeline
Log In to Comment