Repository navigation
[MASSEMBLY-852] Set defaultDirectoryMode alongside directoryMode in AddDirectoryTask - #1401
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
When a fileSet's include pattern (e.g. "*") does not match the fileSet root itself, the archiver creates the parent directory entries for the matched files implicitly, and those fall back to its defaultDirectoryMode instead of the override directoryMode set here. A directoryMode configured on the fileSet was silently lost for those directories, as reported in MASSEMBLY-852. Set and restore defaultDirectoryMode together with directoryMode so both paths get the configured mode. Claude-Session: https://claude.ai/code/session_0153qyh22xBMN1vPfWGz3jSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1058 (MASSEMBLY-852).
AddDirectoryTask sets archiver.setDirectoryMode() (the override mode) from the fileSet's directoryMode, but when the include pattern doesn't match the fileSet root itself (e.g. a plain "*"), the parent directories the archiver creates implicitly for the matched files fall back to its defaultDirectoryMode instead, which this task never touched. That's why a fileSet with an include pattern kept losing its configured directory permissions while the same fileSet without includes did not.
This sets and restores defaultDirectoryMode alongside directoryMode, following the same approach suggested on the issue and in the earlier, unmerged #37. Added a unit test that reproduces the gap (fails without the fix) by asserting setDefaultDirectoryMode is called and restored the same way setDirectoryMode already is.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004, check one of the following: