Skip to content

[match] Fix match nuke deletion for provisioning profiles with wildcard filenames#30014

Merged
iBotPeaches merged 1 commit into
fastlane:masterfrom
nakshatrasinghh:30002-match-nuke-literal-pathspecs
May 4, 2026
Merged

[match] Fix match nuke deletion for provisioning profiles with wildcard filenames#30014
iBotPeaches merged 1 commit into
fastlane:masterfrom
nakshatrasinghh:30002-match-nuke-literal-pathspecs

Conversation

@nakshatrasinghh

@nakshatrasinghh nakshatrasinghh commented May 4, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #30002

match nuke can fail when deleting provisioning profiles from git-backed storage if a profile filename contains a literal wildcard character, such as *.

Although fastlane shell-escapes the filename before calling git rm, Git still interprets the argument as a pathspec. This can cause a wildcard profile filename to match neighboring profile files, so a later deletion command fails with pathspec ... did not match any files.

Description

This updates Match::Storage::GitStorage#delete_files to remove files with:

git --literal-pathspecs rm -- <path>

Using Git's literal pathspec mode makes wildcard characters in provisioning profile filenames behave literally while preserving the existing shell escaping.

A regression spec was added for git-backed storage deletion with both a literal wildcard provisioning profile filename and a neighboring filename that would previously be matched by that wildcard.

Testing Steps

Targeted tests:

rbenv exec bundle exec rspec match/spec/nuke_spec.rb match/spec/storage/git_storage_spec.rb

Result:

13 examples, 0 failures

Style check:

RUBOCOP_CACHE_ROOT=/private/tmp/fastlane-rubocop-cache rbenv exec bundle exec rubocop -a

Result:

1313 files inspected, no offenses detected

I also validated the behavior with a temporary local bare git remote containing wildcard and neighboring provisioning profile filenames. The patched deletion flow removed all files successfully, while reproducing the old git rm <escaped path> behavior failed on the second matched profile, matching the reported issue.

@iBotPeaches iBotPeaches changed the title Fix match nuke deletion for provisioning profiles with wildcard filenames [match] Fix match nuke deletion for provisioning profiles with wildcard filenames May 4, 2026

@iBotPeaches iBotPeaches left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I confirmed --literal-pathspecs was added to git in 2011, so plenty old enough to assume everyone has it.

@iBotPeaches iBotPeaches merged commit 26ef165 into fastlane:master May 4, 2026
9 checks passed

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nakshatrasinghh 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a month, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀"

@nakshatrasinghh nakshatrasinghh deleted the 30002-match-nuke-literal-pathspecs branch May 5, 2026 04:45

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations! 🎉 This was released as part of fastlane 2.234.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[match nuke] Fails when provisioning profile filename contains wildcard characters (*)

2 participants