Skip to content

Commit

Permalink
repository: preserve file mode on write_archive()
Browse files Browse the repository at this point in the history
Reference: libgit2#616
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
  • Loading branch information
Igor Gnatenko committed Apr 6, 2016
1 parent 51915dd commit d67fc42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pygit2/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
else:
from io import BytesIO as StringIO

import os
import six

# Import from pygit2
Expand Down Expand Up @@ -805,6 +806,7 @@ def write_archive(self, treeish, archive, timestamp=None, prefix=''):
info.size = 0
archive.addfile(info)
else:
info.mode = oct(os.stat(self[entry.id]).st_mode & 0o777)
archive.addfile(info, StringIO(content))

#
Expand Down

0 comments on commit d67fc42

Please sign in to comment.