pull/4791/head
Your Name 6 months ago
parent db7ac5d068
commit 543beec2bf
  1. 7
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 14
      libs/remix-ui/git/src/lib/gitactions.ts

@ -88,7 +88,7 @@ class DGitProvider extends Plugin {
async addIsomorphicGitConfig(input) {
const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token')
return {
corsProxy: 'https://corsproxy.remixproject.org/',
//corsProxy: 'http://192.168.1.7:39049',
http,
onAuth: url => {
url
@ -591,6 +591,7 @@ class DGitProvider extends Plugin {
...await this.addIsomorphicGitConfig(input),
...await this.addIsomorphicGitConfigFS()
}
console.log(cmd)
this.call('terminal', 'logHtml', `Cloning ${input.url}...`)
const result = await git.clone(cmd)
if (!input.workspaceExists) {
@ -740,7 +741,7 @@ class DGitProvider extends Plugin {
const cmd = {
force: input.force,
ref: input.ref.name,
remoteRef: input.remoteRef.name,
remoteRef: input.remoteRef && input.remoteRef.name,
remote: input.remote.name,
author: await this.getCommandUser(input),
input,
@ -767,7 +768,7 @@ class DGitProvider extends Plugin {
async pull(input: pullInputType) {
const cmd = {
ref: input.ref.name,
remoteRef: input.remoteRef.name,
remoteRef: input.remoteRef && input.remoteRef.name,
author: await this.getCommandUser(input),
remote: input.remote.name,
input,

@ -294,16 +294,13 @@ export const checkout = async (cmd: checkoutInput) => {
export const clone = async (input: cloneInputType) => {
dispatch(setLoading(true))
const urlParts = input.url.split("/");
const lastPart = urlParts[urlParts.length - 1];
const repoName = lastPart.split(".")[0];
const timestamp = new Date().getTime();
const repoNameWithTimestamp = `${repoName}-${timestamp}`;
try {
await disableCallBacks()
// get last part of url
const urlParts = input.url.split("/");
const lastPart = urlParts[urlParts.length - 1];
const repoName = lastPart.split(".")[0];
// add timestamp to repo name
const timestamp = new Date().getTime();
const repoNameWithTimestamp = `${repoName}-${timestamp}`;
//const token = await tokenWarning();
const token = await plugin.call('config' as any, 'getAppParameter' as any, 'settings/gist-access-token')
await plugin.call('dgitApi', 'clone', { ...input, workspaceName: repoNameWithTimestamp });
@ -315,6 +312,7 @@ export const clone = async (input: cloneInputType) => {
})
//}
} catch (e: any) {
//await plugin.call('filePanel', 'deleteWorkspace', repoNameWithTimestamp)
await parseError(e)
}
dispatch(setLoading(false))

Loading…
Cancel
Save