summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-08-20 18:28:54 -0700
committerDan Davison <dandavison7@gmail.com>2021-08-20 19:58:07 -0700
commitcf686e93b500de9d7de2fe2f824ce94018cbec24 (patch)
treef6ac02421da0dc70d07500439d7952b3ea1cc288 /src
parent601ebdb9d93e9a5b76424b2b8f24ed5064a1a262 (diff)
Revert "Add failing test that gitconfig insteadOf is honored"
Diffstat (limited to 'src')
-rw-r--r--src/features/hyperlinks.rs41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/features/hyperlinks.rs b/src/features/hyperlinks.rs
index 2dad4a9d..2d3ad3b0 100644
--- a/src/features/hyperlinks.rs
+++ b/src/features/hyperlinks.rs
@@ -110,44 +110,3 @@ fn format_commit_line_captures_with_osc8_commit_hyperlink(
fn format_github_commit_url(commit: &str, github_repo: &str) -> String {
format!("https://github.com/{}/commit/{}", github_repo, commit)
}
-
-#[cfg(test)]
-mod tests {
- use std::fs::remove_file;
-
- use super::format_commit_line_with_osc8_commit_hyperlink;
- use crate::tests::integration_test_utils;
-
- #[test]
- fn test_commit_hyperlink_honors_insteadof() {
- let git_config_contents = br#"
-[remote "origin"]
- url = github:dandavison/delta
- fetch = +refs/heads/*:refs/remotes/origin/*
-[url "https://github.com/"]
- insteadOf = github:
-[url "ssh://git@github.com/"]
- pushInsteadOf = github:
- insteadOf = githubpriv:
-"#;
- let git_config_path = "delta__test_commit_hyperlink_honors_insteadof";
- let config = integration_test_utils::make_config_from_args_and_git_config(
- &[],
- Some(git_config_contents),
- Some(git_config_path),
- );
- let hash = "342016d0a69d8361dc17396d9a441704416eb7bb";
- let line = format!("commit {}", hash);
- // TODO: This doesn't work because a git2::Repository is needed in order
- // to compute the remote URL but we do not actually have a repositoty
- // since the utility make_config_from_args_and_git_config creates a
- // GitConfig struct with a null Repository.
- let formatted = format_commit_line_with_osc8_commit_hyperlink(&line, &config);
- assert!(formatted.contains(&format!(
- "https://github.com/dandavison/delta/commit/{}",
- hash
- )));
-
- remove_file(git_config_path).unwrap();
- }
-}