1818 */
1919
2020/*
21- * Copyright (c) 2009, 2024 , Oracle and/or its affiliates. All rights reserved.
21+ * Copyright (c) 2009, 2025 , Oracle and/or its affiliates. All rights reserved.
2222 * Portions Copyright (c) 2017, Chris Fraire <[email protected] >. 2323 */
2424package org .opengrok .indexer .history ;
@@ -483,8 +483,9 @@ void testBuildTagListInitial() throws Exception {
483483 }
484484
485485 /**
486- * Clone the original repository, add new tag, check that the extracted tags contain the pre-existing
487- * and new one.
486+ * Clone the original repository, create branch and add tag to the branch, switch back to the original branch,
487+ * add new tag, check that the extracted tags contain the pre-existing and new one
488+ * but not the non-default branch tag.
488489 */
489490 @ Test
490491 void testBuildTagListOneMore () throws Exception {
@@ -494,6 +495,18 @@ void testBuildTagListOneMore() throws Exception {
494495 // Clone the internal repository because it will be modified.
495496 // This avoids interference with other tests in this class.
496497 runHgCommand (this .repositoryRoot , "clone" , this .repositoryRoot .toString (), repositoryRootPath .toString ());
498+
499+ // Branch the repo and add one changeset.
500+ runHgCommand (repositoryRoot , "unbundle" ,
501+ Paths .get (getClass ().getResource ("/history/hg-branch.bundle" ).toURI ()).toString ());
502+ // Switch to the branch.
503+ runHgCommand (repositoryRoot , "update" , "mybranch" );
504+ final String branchTagName = "branch_tag" ;
505+ runHgCommand (repositoryRoot , "tag" , branchTagName );
506+
507+ // Switch back to the default branch.
508+ runHgCommand (repositoryRoot , "update" , "default" );
509+
497510 MercurialRepository hgRepo = (MercurialRepository ) RepositoryFactory .getRepository (repositoryRoot );
498511 assertNotNull (hgRepo );
499512 // Using double space on purpose to test the parsing of tags.
0 commit comments