Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repository: don't loose file mode on write_archive() #617

Closed
wants to merge 1 commit into from

Conversation

ignatenkobrain
Copy link
Contributor

Reference: #616
Signed-off-by: Igor Gnatenko ignatenko@redhat.com

@ignatenkobrain
Copy link
Contributor Author

Unfortunately it's missing test, but I don't have time to write it. Please do it yourself ;)

Thanks!

Reference: libgit2#616
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
@carlosmn
Copy link
Member

carlosmn commented Apr 6, 2016

There's a couple of issues with this code:

  1. It assumes that the current working directory will be the repository working directory's root and it assumes it exists, but more importantly,
  2. it stats a file on disk when it's dumping data from an arbitrary tree

The purpose of this method is to write out the contents of the given tree to an archive. The working directory's state should not indicate how we create the result. If the file in the tree is executable and that information is getting lost in the tarball, this still wouldn't be the right solution, because the file in the worktree might not share the exec bit with the file of the same name relative to the current working directory; the current working directory of the script running this may not be the repository's workdir, if it even has one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants