diff --git a/CHANGES.md b/CHANGES.md index ee69eb2..21092e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ Unreleased - Submit is disabled by default. +- Error if target and work branch are the same. ## Version 0.1.0 diff --git a/src/modify_repos/script/base.py b/src/modify_repos/script/base.py index 48dc386..a90f7a2 100644 --- a/src/modify_repos/script/base.py +++ b/src/modify_repos/script/base.py @@ -41,7 +41,11 @@ class Script[RepoType: Repo]: """ def __init__(self, *, submit: bool = False) -> None: - """ """ + if self.target == self.branch: + raise ValueError( + "Work branch name must be different than target branch name." + ) + source_file = inspect.getsourcefile(self.__class__) if source_file is None: diff --git a/uv.lock b/uv.lock index 1008e0f..27d5167 100644 --- a/uv.lock +++ b/uv.lock @@ -335,7 +335,7 @@ wheels = [ [[package]] name = "modify-repos" -version = "0.1.0" +version = "0.1.1.dev0" source = { editable = "." } dependencies = [ { name = "click" },