[LyX/master] Give error if adding a branch that already exists

Scott Kostyshak skostysh at lyx.org
Mon Mar 24 12:22:01 UTC 2025


On Mon, Mar 24, 2025 at 12:16:49PM +0000, Scott Kostyshak wrote:
> commit 7d1eea0301986c6f7a080bfaf8166d051aa71f05
> Author: Scott Kostyshak <skostysh at lyx.org>
> Date:   Mon Mar 24 12:37:05 2025 +0100
> 
>     Give error if adding a branch that already exists
>     
>     The previous behavior was a silent no-op. Now, we inform the user
>     that the branch name already exists, and preserve the field text so
>     it can be easily modified after the message.
> ---
>  src/frontends/qt/GuiBranches.cpp | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Is it OK if I add an assertion (in attached patch) to potentially find
other places where we add a branch that already exists? I feel as though
all cases should handle the situation add a higher level, although I'm
not confident in that claim.

I forget the other ways a branch can be added. I think if it is not
defined (e.g., copy/pasted from a different doc), it can be added. Not
sure which other paths we have to the add() method.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Assert-if-adding-existing-branch-in-container.patch
Type: text/x-diff
Size: 1234 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20250324/4d847755/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20250324/4d847755/attachment.sig>


More information about the lyx-devel mailing list