Use current upstream for permalink to line (#26398)
Release Notes: - git: Copy permalink to line now uses the upstream of the current branch instead of "origin"
This commit is contained in:
@@ -56,6 +56,14 @@ pub struct Upstream {
|
||||
pub tracking: UpstreamTracking,
|
||||
}
|
||||
|
||||
impl Upstream {
|
||||
pub fn remote_name(&self) -> Option<&str> {
|
||||
self.ref_name
|
||||
.strip_prefix("refs/remotes/")
|
||||
.and_then(|stripped| stripped.split("/").next())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
||||
pub enum UpstreamTracking {
|
||||
/// Remote ref not present in local repository.
|
||||
|
||||
Reference in New Issue
Block a user