File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,21 @@ public static DateTimeOffset When(this Commit commit)
17
17
/// <summary>
18
18
/// Checks if the two branch objects refer to the same branch (have the same friendly name).
19
19
/// </summary>
20
- public static bool IsSameBranch ( this Branch branch , Branch otherBranch )
20
+ public static string NameWithoutRemote ( this Branch branch )
21
21
{
22
- // For each branch, fixup the friendly name if the branch is remote.
23
- var otherBranchFriendlyName = otherBranch . IsRemote ?
24
- otherBranch . FriendlyName . Substring ( otherBranch . FriendlyName . IndexOf ( "/" , StringComparison . Ordinal ) + 1 ) :
25
- otherBranch . FriendlyName ;
26
- var branchFriendlyName = branch . IsRemote ?
22
+ return branch . IsRemote ?
27
23
branch . FriendlyName . Substring ( branch . FriendlyName . IndexOf ( "/" , StringComparison . Ordinal ) + 1 ) :
28
24
branch . FriendlyName ;
25
+ }
26
+
27
+ /// <summary>
28
+ /// Checks if the two branch objects refer to the same branch (have the same friendly name).
29
+ /// </summary>
30
+ public static bool IsSameBranch ( this Branch branch , Branch otherBranch )
31
+ {
32
+ // For each branch, fixup the friendly name if the branch is remote.
33
+ var otherBranchFriendlyName = otherBranch . NameWithoutRemote ( ) ;
34
+ var branchFriendlyName = branch . NameWithoutRemote ( ) ;
29
35
30
36
return otherBranchFriendlyName == branchFriendlyName ;
31
37
}
You can’t perform that action at this time.
0 commit comments