File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,21 @@ Vagrant.configure(2) do |config|
484
484
sudo chown #{ user } :#{ user } -R "#{ test_dir } /git2"
485
485
EOF
486
486
487
+ # A third Git repository
488
+ # Regression test for https://github.com/ogham/exa/issues/526
489
+ config . vm . provision :shell , privileged : false , inline : <<-EOF
490
+ set -xe
491
+ mkdir -p "#{ test_dir } /git3"
492
+ cd "#{ test_dir } /git3"
493
+ git init
494
+
495
+ # Create a symbolic link pointing to a non-existing file
496
+ ln -s aaa/aaa/a b
497
+
498
+ find "#{ test_dir } /git3" -exec touch {} -t #{ some_date } \\ ;
499
+ sudo chown #{ user } :#{ user } -R "#{ test_dir } /git3"
500
+ EOF
501
+
487
502
# Hidden and dot file testcases.
488
503
# We need to set the permissions of `.` and `..` because they actually
489
504
# get displayed in the output here, so this has to come last.
Original file line number Diff line number Diff line change @@ -265,11 +265,11 @@ impl Git {
265
265
fn reorient ( path : & Path ) -> PathBuf {
266
266
use std:: env:: current_dir;
267
267
// I’m not 100% on this func tbh
268
- match current_dir ( ) {
268
+ let path = match current_dir ( ) {
269
269
Err ( _) => Path :: new ( "." ) . join ( & path) ,
270
270
Ok ( dir) => dir. join ( & path) ,
271
- } . canonicalize ( ) . unwrap ( ) // errors can be ignored here because they only occur if
272
- // the path does not exist / a component is not a folder
271
+ } ;
272
+ path. canonicalize ( ) . unwrap_or ( path )
273
273
}
274
274
275
275
/// The character to display if the file has been modified, but not staged.
Original file line number Diff line number Diff line change @@ -210,6 +210,9 @@ $exa $testcases/git2/target -l --git 2>&1 | diff -q - $results
210
210
$exa $testcases /git2/deeply/nested/repository -l --git 2>&1 | diff -q - $results /git_2_repository || exit 1
211
211
$exa $testcases /git2/{deeply,ignoreds,target} -l --git 2>&1 | diff -q - $results /git_2_all || exit 1
212
212
213
+ # Regressions test
214
+ $exa $testcases /git3 -l --git & > /dev/null || echo " Failed to display broken symlink in git repository" ; exit 1
215
+
213
216
COLUMNS=150 $exa $testcases /git/** /* $testcases --git --long --grid -d | diff -q - $results /git_1_files || exit 1
214
217
215
218
$exa $testcases /git $testcases /git2 --git --long | diff -q - $results /git_12 || exit 1
You can’t perform that action at this time.
0 commit comments