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