|
|
@ -301,32 +301,7 @@ class DGitProvider extends Plugin<any, CustomRemixApi> { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'compareBranches', { branch, remote }) |
|
|
|
return await this.call('isogit', 'compareBranches', { branch, remote }) |
|
|
|
} |
|
|
|
} |
|
|
|
// Get current branch commits
|
|
|
|
return await isoGit.compareBranches({ branch, remote }, await this.addIsomorphicGitConfigFS()) |
|
|
|
const headCommits = await git.log({ |
|
|
|
|
|
|
|
...await this.addIsomorphicGitConfigFS(), |
|
|
|
|
|
|
|
ref: branch.name, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get remote branch commits
|
|
|
|
|
|
|
|
const remoteCommits = await git.log({ |
|
|
|
|
|
|
|
...await this.addIsomorphicGitConfigFS(), |
|
|
|
|
|
|
|
ref: `${remote.name}/${branch.name}`, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Convert arrays of commit objects to sets of commit SHAs
|
|
|
|
|
|
|
|
const headCommitSHAs = new Set(headCommits.map(commit => commit.oid)); |
|
|
|
|
|
|
|
const remoteCommitSHAs = new Set(remoteCommits.map(commit => commit.oid)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Filter out commits that are only in the remote branch
|
|
|
|
|
|
|
|
const uniqueRemoteCommits = remoteCommits.filter(commit => !headCommitSHAs.has(commit.oid)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// filter out commits that are only in the local branch
|
|
|
|
|
|
|
|
const uniqueHeadCommits = headCommits.filter(commit => !remoteCommitSHAs.has(commit.oid)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
uniqueHeadCommits, |
|
|
|
|
|
|
|
uniqueRemoteCommits, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async getCommitChanges(commitHash1: string, commitHash2: string): Promise<commitChange[]> { |
|
|
|
async getCommitChanges(commitHash1: string, commitHash2: string): Promise<commitChange[]> { |
|
|
|