Skip to content

Commit

Permalink
fix the marker regex
Browse files Browse the repository at this point in the history
Summary: This switches regex to multiline fixing the problem with us not recognising the marker.

Reviewed By: RajivTS, singhsrb

Differential Revision: D64341265

fbshipit-source-id: d8b0bf51e4bbabedf127ac196cb46164fda15d9a
  • Loading branch information
mitrandir77 authored and facebook-github-bot committed Oct 15, 2024
1 parent bee1d91 commit 8747cee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl BlockAccidentalNewBookmarkCreationHook {
}) = config.allow_creations_with_marker
{
let marker_extraction_regex = Regex::new(&format!(
r"^{}:\s*(?<{}>.+?)(\s|$|\n)",
r"(?m)^{}:\s*(?<{}>.+?)(\s|$|\n)",
&marker, &NAMED_CAPTURE_NAME
))?;
Some(CreationAllowedWithMarkerOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@

$ git_client push origin brand_new_branch2
To https://localhost:$LOCAL_PORT/repos/git/ro/repo.git
! [remote rejected] brand_new_branch2 -> brand_new_branch2 (hooks failed:
block_accidental_new_bookmark_creation for 8c3df9fb1ac00e7b3f93ca1d4e6557cb34e54da9: Add "@new-branch: brand_new_branch2" to the commit message to be able to create this branch.

For more information about hooks and bypassing, refer https://fburl.com/wiki/mb4wtk1j)
error: failed to push some refs to 'https://localhost:$LOCAL_PORT/repos/git/ro/repo.git'
[1]
* [new branch] brand_new_branch2 -> brand_new_branch2
$ quiet git checkout HEAD^

# now test the bypass based on bookmark matching a regex
Expand Down

0 comments on commit 8747cee

Please sign in to comment.