summaryrefslogtreecommitdiffstats
path: root/src/handlers
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2022-01-06 18:33:36 -0500
committerDan Davison <dandavison7@gmail.com>2022-01-17 18:30:32 -0500
commite9e9fb7c6975ae9f0a04cf4f14fec4a38c281af1 (patch)
tree71d2dff2ce102caac56c91dc1311b73241b9b11a /src/handlers
parentfb38eddd9a8b6faa079ff8bdac2affc3b7c3f2b3 (diff)
Construct hyperlink file path relative to cwd
Fixes #890
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/hunk_header.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/handlers/hunk_header.rs b/src/handlers/hunk_header.rs
index f1d90900..32d0bea5 100644
--- a/src/handlers/hunk_header.rs
+++ b/src/handlers/hunk_header.rs
@@ -316,7 +316,6 @@ fn write_to_output_buffer(
pub mod tests {
use super::*;
use crate::ansi::strip_ansi_codes;
- use crate::git_config::GitConfigEntry;
use crate::tests::integration_test_utils;
#[test]
@@ -410,14 +409,11 @@ pub mod tests {
// returns a hyperlinked file path with line number.
let mut cfg = integration_test_utils::make_config_from_args(&["--features", "hyperlinks"]);
- cfg.git_config_entries.insert(
- "delta.__workdir__".to_string(),
- GitConfigEntry::Path("/some/workdir".into()),
- );
+ cfg.cwd = Some("/some/current/directory".into());
let result = paint_file_path_with_line_number(Some(3), "some-file", &cfg);
- assert_eq!(result, "\u{1b}]8;;file:///some/workdir/some-file\u{1b}\\\u{1b}[34m3\u{1b}[0m\u{1b}]8;;\u{1b}\\");
+ assert_eq!(result, "\u{1b}]8;;file:///some/current/directory/some-file\u{1b}\\\u{1b}[34m3\u{1b}[0m\u{1b}]8;;\u{1b}\\");
}
#[test]