@@ -166,7 +166,7 @@ public void commentNoUnexpectedReference() throws Exception {
166166
167167 assertNotNull (ticketService .updateTicket (repo , a .number , newComment ("comment for 1 - no reference" )));
168168 assertNotNull (ticketService .updateTicket (repo , a .number , newComment ("comment for # - no reference" )));
169- assertNotNull (ticketService .updateTicket (repo , a .number , newComment ("comment for #42 - ignores invalid reference" )));
169+ assertNotNull (ticketService .updateTicket (repo , a .number , newComment ("comment for #999 - ignores invalid reference" )));
170170
171171 a = ticketService .getTicket (repo , a .number );
172172 b = ticketService .getTicket (repo , b .number );
@@ -272,7 +272,7 @@ public void commitMasterNoUnexpectedReference() throws Exception {
272272
273273 makeCommit ("commit for 1 - no reference" );
274274 makeCommit ("comment for # - no reference" );
275- final RevCommit revCommit1 = makeCommit ("comment for #42 - ignores invalid reference" );
275+ final RevCommit revCommit1 = makeCommit ("comment for #999 - ignores invalid reference" );
276276 final String commit1Sha = revCommit1 .name ();
277277
278278 assertPushSuccess (commit1Sha , branchName );
@@ -396,7 +396,7 @@ public void commitPatchsetNoUnexpectedReference() throws Exception {
396396
397397 makeCommit ("commit for 1 - no reference" );
398398 makeCommit ("commit for # - no reference" );
399- final String message = "commit for #42 - ignores invalid reference" ;
399+ final String message = "commit for #999 - ignores invalid reference" ;
400400 final RevCommit revCommit1 = makeCommit (message );
401401 final String commit1Sha = revCommit1 .name ();
402402
@@ -587,7 +587,7 @@ public void commitTicketBranchNoUnexpectedReference() throws Exception {
587587
588588 makeCommit ("commit for 1 - no reference" );
589589 makeCommit ("commit for # - no reference" );
590- final String message = "commit for #42 - ignores invalid reference" ;
590+ final String message = "commit for #999 - ignores invalid reference" ;
591591 final RevCommit revCommit1 = makeCommit (message );
592592 final String commit1Sha = revCommit1 .name ();
593593 assertPushSuccess (commit1Sha , branchName );
@@ -647,6 +647,38 @@ public void commitTicketBranchSingleReference() throws Exception {
647647 assertEquals (commit1Sha , cRefB .get (0 ).hash );
648648 }
649649
650+ @ Test
651+ public void commitTicketBranchMultiCommit () throws Exception {
652+ setPatchsetAvailable (false );
653+ TicketModel a = ticketService .createTicket (repo , newTicket ("commitTicketBranchMultiCommit-A" ));
654+ TicketModel b = ticketService .createTicket (repo , newTicket ("commitTicketBranchMultiCommit-B" ));
655+
656+ String branchName = String .format ("ticket/%d" , a .number );
657+ git .checkout ().setCreateBranch (true ).setName (branchName ).call ();
658+
659+ final String message1 = String .format ("commit for #%d - patchset multi commit 1" , b .number );
660+ final RevCommit revCommit1 = makeCommit (message1 );
661+ final String commit1Sha = revCommit1 .name ();
662+
663+ final String message2 = String .format ("commit for #%d - patchset multi commit 2" , b .number );
664+ final RevCommit revCommit2 = makeCommit (message2 );
665+ final String commit2Sha = revCommit2 .name ();
666+
667+ assertPushSuccess (commit2Sha , branchName );
668+
669+ a = ticketService .getTicket (repo , a .number );
670+ b = ticketService .getTicket (repo , b .number );
671+ assertFalse (a .hasReferences ());
672+ assertTrue (b .hasReferences ());
673+
674+ List <Reference > cRefB = b .getReferences ();
675+ assertNotNull (cRefB );
676+ assertEquals (2 , cRefB .size ());
677+ assertNull (cRefB .get (0 ).ticketId );
678+ assertEquals (commit1Sha , cRefB .get (1 ).hash );
679+ assertEquals (commit2Sha , cRefB .get (0 ).hash );
680+ }
681+
650682 @ Test
651683 public void commitTicketBranchMultiReference () throws Exception {
652684 setPatchsetAvailable (false );
0 commit comments