@@ -135,6 +135,8 @@ pub mod convert_to_diffable {
135
135
pub enum Error {
136
136
#[ error( "Entry at '{rela_path}' must be regular file or symlink, but was {actual:?}" ) ]
137
137
InvalidEntryKind { rela_path : BString , actual : EntryKind } ,
138
+ #[ error( "Entry at '{rela_path}' is declared as symlink but symlinks are disabled via core.symlinks" ) ]
139
+ SymlinkDisabled { rela_path : BString } ,
138
140
#[ error( "Entry at '{rela_path}' could not be read as symbolic link" ) ]
139
141
ReadLink { rela_path : BString , source : std:: io:: Error } ,
140
142
#[ error( "Entry at '{rela_path}' could not be opened for reading or read from" ) ]
@@ -240,7 +242,7 @@ impl Pipeline {
240
242
out : & mut Vec < u8 > ,
241
243
) -> Result < Outcome , convert_to_diffable:: Error > {
242
244
let is_symlink = match mode {
243
- EntryKind :: Link if self . options . fs . symlink => true ,
245
+ EntryKind :: Link => true ,
244
246
EntryKind :: Blob | EntryKind :: BlobExecutable => false ,
245
247
_ => {
246
248
return Err ( convert_to_diffable:: Error :: InvalidEntryKind {
@@ -272,6 +274,11 @@ impl Pipeline {
272
274
self . path . push ( root) ;
273
275
self . path . push ( gix_path:: from_bstr ( rela_path) ) ;
274
276
let data = if is_symlink {
277
+ if !self . options . fs . symlink {
278
+ return Err ( convert_to_diffable:: Error :: SymlinkDisabled {
279
+ rela_path : rela_path. to_owned ( ) ,
280
+ } ) ;
281
+ }
275
282
let target = none_if_missing ( std:: fs:: read_link ( & self . path ) ) . map_err ( |err| {
276
283
convert_to_diffable:: Error :: ReadLink {
277
284
rela_path : rela_path. to_owned ( ) ,
0 commit comments