Fix another remote line bug in the commit graph

This commit is contained in:
Mattias Granlund 2024-06-03 23:05:02 +02:00
parent 850c8119e4
commit 71aeb9a285

View File

@ -49,12 +49,18 @@
let baseIsUnfolded = false; let baseIsUnfolded = false;
function getRemoteOutType(commit: Commit): CommitStatus | undefined { function getRemoteOutType(commit: Commit): CommitStatus | undefined {
let parent = commit.parent; if (!hasShadowedCommits) {
let upstreamCommit = commit.relatedTo; const childStatus = commit.children?.[0]?.status;
return childStatus != 'local' ? childStatus : undefined;
}
while (!upstreamCommit && parent) { // TODO: Consider introducing `relatedParent` and `relatedChildren`
parent = parent.parent; let upstreamCommit = commit.relatedTo;
upstreamCommit = parent?.relatedTo; let pointer: Commit | undefined = commit;
while (!upstreamCommit && pointer) {
pointer = pointer.parent;
upstreamCommit = pointer?.relatedTo;
} }
if (!upstreamCommit) return hasUnknownCommits ? 'upstream' : undefined; if (!upstreamCommit) return hasUnknownCommits ? 'upstream' : undefined;