File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -202,10 +202,19 @@ func FromViper(v *viper.Viper) (*Config, error) {
202202 }
203203
204204 // resolve tree root to an absolute path
205- if cfg .TreeRoot , err = filepath .Abs (cfg .TreeRoot ); err != nil {
205+ absTreeRoot , err := filepath .Abs (cfg .TreeRoot );
206+ if err != nil {
206207 return nil , fmt .Errorf ("failed to get absolute path for tree root: %w" , err )
207208 }
208209
210+ // resolve symlinks in tree root
211+ evalSymlinkTreeRoot , err := filepath .EvalSymlinks (absTreeRoot )
212+ if err != nil {
213+ return nil , fmt .Errorf ("tree root %s not found: %w" , absTreeRoot , err )
214+ }
215+
216+ cfg .TreeRoot = evalSymlinkTreeRoot
217+
209218 // prefer top level excludes, falling back to global.excludes for backwards compatibility
210219 if len (cfg .Excludes ) == 0 {
211220 cfg .Excludes = cfg .Global .Excludes
You can’t perform that action at this time.
0 commit comments