Skip to content

Commit 689fd20

Browse files
committed
Merge pull request #738 from JakeGinnivan/IsSameBranchIssue
Fixed #731
2 parents ba378ad + 6fe7322 commit 689fd20

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/GitVersionCore/LibGitExtensions.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static Commit FindCommitBranchWasBranchedFrom([NotNull] this Branch branc
6161
{
6262
if (branch.Tip == null)
6363
{
64-
Logger.WriteWarning(String.Format(missingTipFormat, branch.Name));
64+
Logger.WriteWarning(string.Format(missingTipFormat, branch.Name));
6565
return null;
6666
}
6767

@@ -70,7 +70,7 @@ public static Commit FindCommitBranchWasBranchedFrom([NotNull] this Branch branc
7070
{
7171
if (b.Tip == null)
7272
{
73-
Logger.WriteWarning(String.Format(missingTipFormat, b.Name));
73+
Logger.WriteWarning(string.Format(missingTipFormat, b.Name));
7474
return null;
7575
}
7676

@@ -86,10 +86,9 @@ public static Commit FindCommitBranchWasBranchedFrom([NotNull] this Branch branc
8686
}
8787
}
8888

89-
9089
static bool IsSameBranch(Branch branch, Branch b)
9190
{
92-
return (b.IsRemote ? b.Name.Replace(b.Remote.Name + "/", string.Empty) : b.Name) != branch.Name;
91+
return (b.IsRemote ? b.Name.Substring(b.Name.IndexOf("/", StringComparison.Ordinal) + 1) : b.Name) != branch.Name;
9392
}
9493

9594
public static IEnumerable<Branch> GetBranchesContainingCommit([NotNull] this Commit commit, IRepository repository, IList<Branch> branches, bool onlyTrackedBranches)

0 commit comments

Comments
 (0)