File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,9 @@ def _list_files_in_archive():
129129 cmd = ['git' , 'archive' , 'HEAD' ]
130130 proc = subprocess .Popen (cmd , stdout = subprocess .PIPE )
131131 tf = tarfile .open (fileobj = proc .stdout , mode = 'r|*' )
132- for name in tf .getnames ():
133- print (name )
132+ for member in tf .getmembers ():
133+ if member .type != tarfile .DIRTYPE :
134+ print (member .name )
134135
135136
136137if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -124,3 +124,12 @@ def test_git_archive_export_ignore(wd):
124124 wd ('git add test1.txt test2.txt' )
125125 wd .commit ()
126126 assert integration .find_files (str (wd .cwd )) == ['test1.txt' ]
127+
128+
129+ @pytest .mark .issue (228 )
130+ def test_git_archive_subdirectory (wd ):
131+ wd ('mkdir foobar' )
132+ wd .write ('foobar/test1.txt' , 'test' )
133+ wd ('git add foobar' )
134+ wd .commit ()
135+ assert integration .find_files (str (wd .cwd )) == ['foobar/test1.txt' ]
You can’t perform that action at this time.
0 commit comments