Display a warning message when asked to operate on a file inside a directory that's a symbolic link to elsewhere
This relicates git's behavior. It adds a few stat calls for the command line parameters, so there is some minor slowdown, but even with thousands of parameters it will not be very noticable, and git does the same statting in similar circumstances. Note that this does not prevent eg "git annex add symlink"; the symlink will be added to git as usual. And "git annex find symlink" will silently list nothing as well. It's only "symlink/foo" or "subdir/symlink/foo" that triggers the warning.
This commit is contained in:
parent
39d7e6dd2a
commit
2a8fdfc7d8
4 changed files with 33 additions and 10 deletions
|
@ -88,7 +88,7 @@ parentDir :: FilePath -> FilePath
|
|||
parentDir = takeDirectory . dropTrailingPathSeparator
|
||||
|
||||
{- Just the parent directory of a path, or Nothing if the path has no
|
||||
- parent (ie for "/" or ".") -}
|
||||
- parent (ie for "/" or "." or "foo") -}
|
||||
upFrom :: FilePath -> Maybe FilePath
|
||||
upFrom dir
|
||||
| length dirs < 2 = Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue