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():
129
129
cmd = ['git' , 'archive' , 'HEAD' ]
130
130
proc = subprocess .Popen (cmd , stdout = subprocess .PIPE )
131
131
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 )
134
135
135
136
136
137
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -124,3 +124,12 @@ def test_git_archive_export_ignore(wd):
124
124
wd ('git add test1.txt test2.txt' )
125
125
wd .commit ()
126
126
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