File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,22 @@ def test_last_line_precedence(self):
902
902
['*.md' , '!README*.md' , 'README-secret.md' ]
903
903
) == set (['README.md' , 'README-bis.md' ])
904
904
905
+ def test_parent_directory (self ):
906
+ base = make_tree (
907
+ [],
908
+ ['a.py' ,
909
+ 'b.py' ,
910
+ 'c.py' ])
911
+ # Dockerignore reference stipulates that absolute paths are
912
+ # equivalent to relative paths, hence /../foo should be
913
+ # equivalent to ../foo. It also stipulates that paths are run
914
+ # through Go's filepath.Clean, which explicitely "replace
915
+ # "/.." by "/" at the beginning of a path".
916
+ assert exclude_paths (
917
+ base ,
918
+ ['../a.py' , '/../b.py' ]
919
+ ) == set (['c.py' ])
920
+
905
921
906
922
class TarTest (unittest .TestCase ):
907
923
def test_tar_with_excludes (self ):
You can’t perform that action at this time.
0 commit comments