File tree Expand file tree Collapse file tree 2 files changed +2
-32
lines changed
Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Original file line number Diff line number Diff line change @@ -87,16 +87,6 @@ mod tests {
8787
8888 os_string. push ( "gitui $# ' " ) ;
8989
90- #[ cfg( windows) ]
91- {
92- use std:: os:: windows:: ffi:: OsStringExt ;
93-
94- const INVALID_UTF16 : & [ u16 ] = & [ 0xD83D ] ;
95-
96- os_string. push ( OsString :: from_wide ( INVALID_UTF16 ) ) ;
97-
98- assert ! ( os_string. to_str( ) . is_none( ) ) ;
99- }
10090 #[ cfg( target_os = "linux" ) ]
10191 {
10292 use std:: os:: unix:: ffi:: OsStrExt ;
Original file line number Diff line number Diff line change 1- use git2:: Repository ;
1+ use git2:: { IntoCString , Repository } ;
22
33use crate :: { error:: Result , HookResult , HooksError } ;
44
@@ -146,27 +146,7 @@ impl HookPaths {
146146 if let Some ( hook) = hook. to_str ( ) {
147147 os_str. push ( hook. replace ( '\'' , REPLACEMENT ) ) ;
148148 } else {
149- #[ cfg( windows) ]
150- {
151- use std:: os:: windows:: ffi:: {
152- OsStrExt , OsStringExt ,
153- } ;
154-
155- let mut new_str: Vec < u16 > = vec ! [ ] ;
156-
157- for ch in hook. as_os_str ( ) . encode_wide ( ) {
158- if ch == ( b'\'' as u16 ) {
159- new_str. extend (
160- std:: ffi:: OsStr :: new ( REPLACEMENT )
161- . encode_wide ( ) ,
162- ) ;
163- } else {
164- new_str. push ( ch) ;
165- }
166- }
167-
168- os_str. push ( OsString :: from_wide ( & new_str) ) ;
169- }
149+ return Err ( HooksError :: PathToString ) ;
170150 }
171151 os_str. push ( "'" ) ;
172152 os_str. push ( " \" $@\" " ) ;
You can’t perform that action at this time.
0 commit comments