@@ -601,21 +601,21 @@ public void UpdatingADirectReferenceTargetWithARevparsePointingAtAnUnknownObject
601
601
}
602
602
603
603
[ Fact ]
604
- public void CanMoveAReferenceToADeeperReferenceHierarchy ( )
604
+ public void CanRenameAReferenceToADeeperReferenceHierarchy ( )
605
605
{
606
606
string path = CloneBareTestRepo ( ) ;
607
607
using ( var repo = new Repository ( path ) )
608
608
{
609
609
const string newName = "refs/tags/test/deep" ;
610
610
611
- Reference moved = repo . Refs . Move ( "refs/tags/test" , newName ) ;
612
- Assert . NotNull ( moved ) ;
613
- Assert . Equal ( newName , moved . CanonicalName ) ;
611
+ Reference renamed = repo . Refs . Rename ( "refs/tags/test" , newName ) ;
612
+ Assert . NotNull ( renamed ) ;
613
+ Assert . Equal ( newName , renamed . CanonicalName ) ;
614
614
}
615
615
}
616
616
617
617
[ Fact ]
618
- public void CanMoveAReferenceToAUpperReferenceHierarchy ( )
618
+ public void CanRenameAReferenceToAUpperReferenceHierarchy ( )
619
619
{
620
620
string path = CloneBareTestRepo ( ) ;
621
621
using ( var repo = new Repository ( path ) )
@@ -624,14 +624,14 @@ public void CanMoveAReferenceToAUpperReferenceHierarchy()
624
624
const string oldName = newName + "/mio" ;
625
625
626
626
repo . Refs . Add ( oldName , repo . Head . CanonicalName ) ;
627
- Reference moved = repo . Refs . Move ( oldName , newName ) ;
628
- Assert . NotNull ( moved ) ;
629
- Assert . Equal ( newName , moved . CanonicalName ) ;
627
+ Reference renamed = repo . Refs . Rename ( oldName , newName ) ;
628
+ Assert . NotNull ( renamed ) ;
629
+ Assert . Equal ( newName , renamed . CanonicalName ) ;
630
630
}
631
631
}
632
632
633
633
[ Fact ]
634
- public void CanMoveAReferenceToADifferentReferenceHierarchy ( )
634
+ public void CanRenameAReferenceToADifferentReferenceHierarchy ( )
635
635
{
636
636
string path = CloneBareTestRepo ( ) ;
637
637
using ( var repo = new Repository ( path ) )
@@ -643,38 +643,38 @@ public void CanMoveAReferenceToADifferentReferenceHierarchy()
643
643
644
644
var oldId = repo . Refs [ oldName ] . ResolveToDirectReference ( ) . Target . Id ;
645
645
646
- Reference moved = repo . Refs . Move ( oldName , newName ) ;
647
- Assert . NotNull ( moved ) ;
648
- Assert . Equal ( newName , moved . CanonicalName ) ;
649
- Assert . Equal ( oldId , moved . ResolveToDirectReference ( ) . Target . Id ) ;
646
+ Reference renamed = repo . Refs . Rename ( oldName , newName ) ;
647
+ Assert . NotNull ( renamed ) ;
648
+ Assert . Equal ( newName , renamed . CanonicalName ) ;
649
+ Assert . Equal ( oldId , renamed . ResolveToDirectReference ( ) . Target . Id ) ;
650
650
651
- AssertRefLogEntry ( repo , newName , moved . ResolveToDirectReference ( ) . Target . Id ,
651
+ AssertRefLogEntry ( repo , newName , renamed . ResolveToDirectReference ( ) . Target . Id ,
652
652
string . Format ( "reference: renamed {0} to {1}" , oldName , newName ) ) ;
653
653
}
654
654
}
655
655
656
656
[ Fact ]
657
- public void MovingANonExistingReferenceThrows ( )
657
+ public void RenamingANonExistingReferenceThrows ( )
658
658
{
659
659
using ( var repo = new Repository ( BareTestRepoPath ) )
660
660
{
661
- Assert . Throws < LibGit2SharpException > ( ( ) => repo . Refs . Move ( "refs/tags/i-am-void" , "refs/atic/tagtest" ) ) ;
661
+ Assert . Throws < LibGit2SharpException > ( ( ) => repo . Refs . Rename ( "refs/tags/i-am-void" , "refs/atic/tagtest" ) ) ;
662
662
}
663
663
}
664
664
665
665
[ Fact ]
666
- public void CanMoveAndOverWriteAExistingReference ( )
666
+ public void CanRenameAndOverWriteAExistingReference ( )
667
667
{
668
668
string path = CloneBareTestRepo ( ) ;
669
669
using ( var repo = new Repository ( path ) )
670
670
{
671
671
const string oldName = "refs/heads/packed" ;
672
672
const string newName = "refs/heads/br2" ;
673
673
674
- Reference moved = repo . Refs . Move ( oldName , newName , allowOverwrite : true ) ;
674
+ Reference renamed = repo . Refs . Rename ( oldName , newName , allowOverwrite : true ) ;
675
675
676
676
Assert . Null ( repo . Refs [ oldName ] ) ;
677
- Assert . NotNull ( repo . Refs [ moved . CanonicalName ] ) ;
677
+ Assert . NotNull ( repo . Refs [ renamed . CanonicalName ] ) ;
678
678
}
679
679
}
680
680
@@ -683,12 +683,12 @@ public void BlindlyOverwritingAExistingReferenceThrows()
683
683
{
684
684
using ( var repo = new Repository ( BareTestRepoPath ) )
685
685
{
686
- Assert . Throws < NameConflictException > ( ( ) => repo . Refs . Move ( "refs/heads/packed" , "refs/heads/br2" ) ) ;
686
+ Assert . Throws < NameConflictException > ( ( ) => repo . Refs . Rename ( "refs/heads/packed" , "refs/heads/br2" ) ) ;
687
687
}
688
688
}
689
689
690
690
[ Fact ]
691
- public void MovingAReferenceDoesNotDecreaseTheRefsCount ( )
691
+ public void RenamingAReferenceDoesNotDecreaseTheRefsCount ( )
692
692
{
693
693
string path = CloneBareTestRepo ( ) ;
694
694
using ( var repo = new Repository ( path ) )
@@ -699,7 +699,7 @@ public void MovingAReferenceDoesNotDecreaseTheRefsCount()
699
699
List < string > refs = repo . Refs . Select ( r => r . CanonicalName ) . ToList ( ) ;
700
700
Assert . True ( refs . Contains ( oldName ) ) ;
701
701
702
- repo . Refs . Move ( oldName , newName ) ;
702
+ repo . Refs . Rename ( oldName , newName ) ;
703
703
704
704
List < string > refs2 = repo . Refs . Select ( r => r . CanonicalName ) . ToList ( ) ;
705
705
Assert . False ( refs2 . Contains ( oldName ) ) ;
@@ -710,18 +710,18 @@ public void MovingAReferenceDoesNotDecreaseTheRefsCount()
710
710
}
711
711
712
712
[ Fact ]
713
- public void CanLookupAMovedReference ( )
713
+ public void CanLookupARenamedReference ( )
714
714
{
715
715
string path = CloneBareTestRepo ( ) ;
716
716
using ( var repo = new Repository ( path ) )
717
717
{
718
718
const string oldName = "refs/tags/test" ;
719
719
const string newName = "refs/atic/tagtest" ;
720
720
721
- Reference moved = repo . Refs . Move ( oldName , newName ) ;
721
+ Reference renamed = repo . Refs . Rename ( oldName , newName ) ;
722
722
723
723
Reference lookedUp = repo . Refs [ newName ] ;
724
- Assert . Equal ( lookedUp , moved ) ;
724
+ Assert . Equal ( lookedUp , renamed ) ;
725
725
}
726
726
}
727
727
0 commit comments