christiangalsterer / stash-filehooks-plugin

An Atlassian Stash plugin to check on various file attributes, like size, name
Apache License 2.0
14 stars 27 forks source link

When multiple size rules use the same size, only last rule is effective #31

Closed raspy closed 7 years ago

raspy commented 7 years ago

If you provide more than one file size rule that use different regexes but the same size, only the last rule is effective. The main reason is that parsed rules are kept in map by allowed size, so the newly parsed rule overwrites previous rule that used the same size.

https://github.com/christiangalsterer/stash-filehooks-plugin/blob/8100e35ac044ae2af673112c81515f2396247472/src/main/java/org/christiangalsterer/stash/filehooks/plugin/hook/FileSizeHook.java#L79

christiangalsterer commented 7 years ago

Thanks for spotting this. will fix it with a next release.

christiangalsterer commented 7 years ago

Fixed in 3.1.0 which is available now in the Atlassian Marketplace.