mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-01 14:04:57 +03:00
Fix a few bugs
This commit is contained in:
parent
12284f33ca
commit
af4833f091
@ -36,7 +36,7 @@
|
||||
remoteCommit={!hasShadowColumn ? remoteCommit : undefined}
|
||||
upstreamLine={upstreamLine && !hasShadowColumn}
|
||||
{first}
|
||||
short={(!!localCommit && !localCommit?.children?.[0]?.relatedTo && !upstreamLine) ||
|
||||
short={(!!localCommit && !localCommit?.children?.[0] && !upstreamLine) ||
|
||||
(!!remoteCommit && !remoteCommit?.children?.[0])}
|
||||
{base}
|
||||
/>
|
||||
|
@ -14,16 +14,11 @@
|
||||
const upstreamCommits = getUpstreamCommits();
|
||||
const baseBranch = getContextStore(BaseBranch);
|
||||
|
||||
$: hasShadowColumn = $localCommits.some((c) => !c.relatedTo || c.id != c.relatedTo.id);
|
||||
$: hasShadowColumn = $localCommits.some((c) => c.relatedTo && c.id != c.relatedTo.id);
|
||||
$: hasLocalColumn = $localCommits.length > 0;
|
||||
$: hasCommits = $branch.commits && $branch.commits.length > 0;
|
||||
$: headCommit = $branch.commits.at(0);
|
||||
|
||||
$: unknownCommits = $upstreamCommits.filter((c) => !c.relatedTo || c.id != c.relatedTo.id);
|
||||
$: $upstreamCommits.forEach((c) => console.log(`${c.id}, ${c.relatedTo?.id}`));
|
||||
$: console.log(unknownCommits);
|
||||
$: console.log($upstreamCommits);
|
||||
|
||||
$: hasUnknownCommits = unknownCommits.length > 0;
|
||||
</script>
|
||||
|
||||
|
@ -173,7 +173,7 @@ export class Commit {
|
||||
}
|
||||
|
||||
get status(): CommitStatus {
|
||||
if (this.isRemote && !this.relatedTo) return 'remote';
|
||||
if (this.isRemote && (!this.relatedTo || this.id == this.relatedTo.id)) return 'remote';
|
||||
return 'local';
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ function linkAsParentChildren(commits: Commit[] | RemoteCommit[]) {
|
||||
if (j == 0) {
|
||||
commit.children = [];
|
||||
} else {
|
||||
const commit = commits[j - 1];
|
||||
const commit = commits[j];
|
||||
if (commit instanceof Commit) commit.children = [commit];
|
||||
if (commit instanceof RemoteCommit) commit.children = [commit];
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use super::{Oid, Result, Signature, Tree};
|
||||
use bstr::BStr;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Commit<'repo> {
|
||||
commit: git2::Commit<'repo>,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user