mirror of
https://github.com/dandavison/delta.git
synced 2024-10-05 04:17:21 +03:00
Revert "Support insteadOf
replacements in git remote URLs"
This reverts commit d97227ded9
.
This commit is contained in:
parent
98485fcfec
commit
3722146a25
@ -574,13 +574,8 @@ fn set_git_config_entries(opt: &mut cli::Opt, git_config: &mut GitConfig) {
|
|||||||
|
|
||||||
// Strings
|
// Strings
|
||||||
for key in &["remote.origin.url"] {
|
for key in &["remote.origin.url"] {
|
||||||
// We use libgit2 Repository::find_remote() instead of using the value
|
if let Some(string) = git_config.get::<String>(key) {
|
||||||
// of remote.origin.url directly, in order that "insteadOf" replacements
|
if let Ok(repo) = GitRemoteRepo::from_str(&string) {
|
||||||
// are honored.
|
|
||||||
// See https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf
|
|
||||||
// and #693
|
|
||||||
if let Some(url) = get_remote_url(git_config) {
|
|
||||||
if let Ok(repo) = GitRemoteRepo::from_str(&url) {
|
|
||||||
opt.git_config_entries
|
opt.git_config_entries
|
||||||
.insert(key.to_string(), GitConfigEntry::GitRemote(repo));
|
.insert(key.to_string(), GitConfigEntry::GitRemote(repo));
|
||||||
}
|
}
|
||||||
@ -597,18 +592,6 @@ fn set_git_config_entries(opt: &mut cli::Opt, git_config: &mut GitConfig) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_remote_url(git_config: &GitConfig) -> Option<String> {
|
|
||||||
Some(
|
|
||||||
git_config
|
|
||||||
.repo
|
|
||||||
.as_ref()?
|
|
||||||
.find_remote("origin")
|
|
||||||
.ok()?
|
|
||||||
.url()?
|
|
||||||
.to_owned(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod tests {
|
pub mod tests {
|
||||||
use std::fs::remove_file;
|
use std::fs::remove_file;
|
||||||
|
Loading…
Reference in New Issue
Block a user