Skip to content

Commit 8e848e8

Browse files
committed
Reject r-l/r updates from non-default branches
1 parent d82fad9 commit 8e848e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/josh-sync/src/sync.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::{env, fs, process, thread};
55

66
const JOSH_PORT: u16 = 42042;
77
const DEFAULT_PR_BRANCH: &str = "update-builtins";
8+
const DEFAULT_BRANCH: &str = "master";
89

910
pub struct GitSync {
1011
upstream_repo: String,
@@ -179,6 +180,12 @@ impl GitSync {
179180
.trim()
180181
.to_string();
181182

183+
let current_branch = check_output(["git", "branch", "--show-current"]);
184+
assert_eq!(
185+
current_branch, DEFAULT_BRANCH,
186+
"refusing to push from non-default branch"
187+
);
188+
182189
// Make sure josh is running.
183190
let _josh = Josh::start();
184191

0 commit comments

Comments
 (0)