|
|
|
@ -65,7 +65,7 @@ export const setUpstreamRemote = async (remote: remote) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getFileStatusMatrix = async (filepaths: string[]) => { |
|
|
|
|
console.log('getFileStatusMatrix', filepaths) |
|
|
|
|
|
|
|
|
|
dispatch(setLoading(true)) |
|
|
|
|
const fileStatusResult = await statusMatrix(filepaths); |
|
|
|
|
fileStatusResult.map((m) => { |
|
|
|
@ -81,7 +81,7 @@ export const getFileStatusMatrix = async (filepaths: string[]) => { |
|
|
|
|
dispatch(fileStatusMerge(fileStatusResult)) |
|
|
|
|
setFileDecorators(fileStatusResult) |
|
|
|
|
} |
|
|
|
|
console.log('getFileStatusMatrix end') |
|
|
|
|
|
|
|
|
|
dispatch(setLoading(false)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ export const getCommits = async (depth: number) => { |
|
|
|
|
"log", |
|
|
|
|
{ ref: "HEAD", depth: depth } |
|
|
|
|
); |
|
|
|
|
console.log('commits', commits) |
|
|
|
|
|
|
|
|
|
return commits; |
|
|
|
|
} catch (e) { |
|
|
|
|
return []; |
|
|
|
@ -101,7 +101,7 @@ export const getCommits = async (depth: number) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const gitlog = async (depth: number) => { |
|
|
|
|
console.log('gitlog start') |
|
|
|
|
|
|
|
|
|
let commits = [] |
|
|
|
|
try { |
|
|
|
|
commits = await getCommits(depth) |
|
|
|
@ -110,7 +110,7 @@ export const gitlog = async (depth: number) => { |
|
|
|
|
dispatch(setCommits(commits)) |
|
|
|
|
await showCurrentBranch() |
|
|
|
|
dispatch(setLoading(false)) |
|
|
|
|
console.log('gitlog end') |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const setStateGitLogCount = async (count: number) => { |
|
|
|
@ -533,7 +533,7 @@ export const remoteBranches = async (owner: string, repo: string) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const remoteCommits = async (url: string, branch: string, length: number) => { |
|
|
|
|
console.log('get remote commits') |
|
|
|
|
|
|
|
|
|
const urlParts = url.split("/"); |
|
|
|
|
|
|
|
|
|
// check if it's github
|
|
|
|
@ -680,9 +680,9 @@ export const loadGitHubUserFromToken = async () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const statusMatrix = async (filepaths: string[]) => { |
|
|
|
|
console.log('calling status') |
|
|
|
|
|
|
|
|
|
const matrix = await plugin.call('dgitApi', 'status', { ref: "HEAD", filepaths: filepaths || ['.']}); |
|
|
|
|
console.log('calling status end') |
|
|
|
|
|
|
|
|
|
const result = (matrix || []).map((x) => { |
|
|
|
|
return { |
|
|
|
|
filename: `/${x.shift()}`, |
|
|
|
@ -745,7 +745,7 @@ export const diff = async (commitChange: commitChange) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getCommitChanges = async (oid1: string, oid2: string, branch?: branch, remote?: remote) => { |
|
|
|
|
console.log('getCommitChanges', oid1, oid2, branch, remote) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
let log |
|
|
|
|
try { |
|
|
|
@ -758,7 +758,7 @@ export const getCommitChanges = async (oid1: string, oid2: string, branch?: bran |
|
|
|
|
console.log(e, 'log error') |
|
|
|
|
} |
|
|
|
|
if (log) { |
|
|
|
|
console.log('log', log) |
|
|
|
|
|
|
|
|
|
const foundCommit = log.find((commit: ReadCommitResult) => commit.oid === oid2) |
|
|
|
|
if (!foundCommit && remote) { |
|
|
|
|
|
|
|
|
@ -795,7 +795,7 @@ async function getRepoDetails(url: string) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const fetchBranch = async (branch: branch, page: number) => { |
|
|
|
|
console.log('fetch branch') |
|
|
|
|
|
|
|
|
|
if (!branch.remote || !branch.remote.url) return |
|
|
|
|
const token = await tokenWarning(); |
|
|
|
|
if (page == 1) { |
|
|
|
@ -815,7 +815,7 @@ export const fetchBranch = async (branch: branch, page: number) => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getBranchDifferences = async (branch: branch, remote: remote, state: gitState) => { |
|
|
|
|
console.log('get branch diff') |
|
|
|
|
|
|
|
|
|
if (!remote && state) { |
|
|
|
|
if (state.defaultRemote) { |
|
|
|
|
remote = state.defaultRemote |
|
|
|
|