Skip to content

Commit cc85723

Browse files
committed
brancher: make brancher cleanup safe against other branchers
If another brancher uses the same push repo we need to make sure we don't overlap on prefixes. Be more careful when deciding if we own a branch. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b84969a commit cc85723

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pw_brancher.py

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ def reap_old(config, state, tree, tgt_remote) -> None:
290290
br = br.strip()
291291
if not br.startswith(r_tgt_pfx + pfx):
292292
continue
293+
# In case our prefix is a prefix of another brancher
294+
if len(br) != len(r_tgt_pfx + pfx + "2000-01-01--00-00"):
295+
continue
293296
br = br[len(r_tgt_pfx):]
294297
found.add(br)
295298
if br not in state["branches"]:

0 commit comments

Comments
 (0)