Skip to content

Commit 8058d38

Browse files
committed
Fix CRLF handling in Gemfile source block idempotency guard
Change the regex pattern to accept both Unix (LF) and Windows (CRLF) line endings by using \r?\n instead of \n. This prevents the idempotency guard from failing on CRLF files, which would cause nested source blocks on re-run.
1 parent 10c0079 commit 8058d38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/socket-patch-core/src/patch/redirect

crates/socket-patch-core/src/patch/redirect/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ fn rewrite_gem(
17861786
let block_re = Regex::new(
17871787
&(String::from(r#"(?m)^source "("#)
17881788
+ &url_pat
1789-
+ r#")" do\n gem ["']"#
1789+
+ r#")" do\r?\n gem ["']"#
17901790
+ &regex::escape(&dep.name)
17911791
+ r#"["']"#),
17921792
)

0 commit comments

Comments
 (0)