Skip to content

Commit 38a3484

Browse files
committed
remove hacks
1 parent f9ff366 commit 38a3484

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

git2-hooks/src/hookspath.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,11 @@ impl HookPaths {
149149
if output.status.success() {
150150
Ok(HookResult::Ok { hook })
151151
} else {
152-
let mut stderr =
152+
let stderr =
153153
String::from_utf8_lossy(&output.stderr).to_string();
154-
let mut stdout =
154+
let stdout =
155155
String::from_utf8_lossy(&output.stdout).to_string();
156156

157-
if cfg!(windows) {
158-
const ANSI_CLEAR: &str = "\x1B[H\x1B[2J\x1B[3J";
159-
160-
for text in [&mut stderr, &mut stdout] {
161-
if let Some(trimmed) =
162-
text.strip_suffix(ANSI_CLEAR)
163-
{
164-
text.truncate(trimmed.len());
165-
}
166-
}
167-
}
168-
169157
Ok(HookResult::RunNotSuccessful {
170158
code: output.status.code(),
171159
stdout,

git2-hooks/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,7 @@ exit 1
428428

429429
#[test]
430430
fn test_env_containing_path() {
431-
const PATH_EXPORT: &str = if cfg!(windows) {
432-
"declare -x PATH="
433-
} else {
434-
"export PATH"
435-
};
431+
const PATH_EXPORT: &str = "export PATH";
436432

437433
let (_td, repo) = repo_init();
438434

0 commit comments

Comments
 (0)