@@ -65,23 +65,17 @@ public int UncommittedChangesCount()
6565
6666 public Branch GetOrCreate ( LibGit2Sharp . Branch innerBranch , Diff repoDiff )
6767 {
68- if ( innerBranch . Tip is null )
69- {
70- return new Branch ( innerBranch , repoDiff , this ) ;
71- }
72-
73- var cacheKey = $ "{ innerBranch . CanonicalName } |{ innerBranch . Tip . Sha } |{ innerBranch . RemoteName } ";
74- return cachedBranches . GetOrAdd ( cacheKey , new Branch ( innerBranch , repoDiff , this ) ) ;
68+ var cacheKey = innerBranch . Tip is null
69+ ? $ "{ innerBranch . RemoteName } /{ innerBranch . CanonicalName } "
70+ : $ "{ innerBranch . RemoteName } /{ innerBranch . CanonicalName } @{ innerBranch . Tip . Sha } ";
71+ return cachedBranches . GetOrAdd ( cacheKey , _ => new Branch ( innerBranch , repoDiff , this ) ) ;
7572 }
7673
77- public Commit GetOrCreate ( LibGit2Sharp . Commit innerCommit , Diff repoDiff ) =>
78- cachedCommits . GetOrAdd ( innerCommit . Sha , new Commit ( innerCommit , repoDiff , this ) ) ;
74+ public Commit GetOrCreate ( LibGit2Sharp . Commit innerCommit , Diff repoDiff )
75+ => cachedCommits . GetOrAdd ( innerCommit . Sha , _ => new Commit ( innerCommit , repoDiff , this ) ) ;
7976
8077 public Tag GetOrCreate ( LibGit2Sharp . Tag innerTag , Diff repoDiff )
81- {
82- var cacheKey = $ "{ innerTag . CanonicalName } |{ innerTag . Target . Sha } ";
83- return cachedTags . GetOrAdd ( cacheKey , new Tag ( innerTag , repoDiff , this ) ) ;
84- }
78+ => cachedTags . GetOrAdd ( innerTag . CanonicalName , _ => new Tag ( innerTag , repoDiff , this ) ) ;
8579
8680 public void Dispose ( )
8781 {
0 commit comments