reset branch diff

pull/5026/head
bunsenstraat 4 months ago committed by Aniket
parent fd751b62ca
commit ae934e4ff4
  1. 7
      libs/remix-ui/git/src/lib/gitactions.ts
  2. 1
      libs/remix-ui/git/src/state/actions.ts
  3. 6
      libs/remix-ui/git/src/state/gitpayload.ts
  4. 6
      libs/remix-ui/git/src/state/gitreducer.tsx

@ -1,6 +1,6 @@
import { ReadBlobResult, ReadCommitResult } from "isomorphic-git";
import React from "react";
import { fileStatus, fileStatusMerge, setRemoteBranchCommits, resetRemoteBranchCommits, setBranches, setCanCommit, setCommitChanges, setCommits, setCurrentBranch, setGitHubUser, setLoading, setRemoteBranches, setRemotes, setRepos, setUpstream, setLocalBranchCommits, setBranchDifferences, setRemoteAsDefault, setScopes, setLog, clearLog, setUserEmails, setCurrenHead, setStoragePayload } from "../state/gitpayload";
import { fileStatus, fileStatusMerge, setRemoteBranchCommits, resetRemoteBranchCommits, setBranches, setCanCommit, setCommitChanges, setCommits, setCurrentBranch, setGitHubUser, setLoading, setRemoteBranches, setRemotes, setRepos, setUpstream, setLocalBranchCommits, setBranchDifferences, setRemoteAsDefault, setScopes, setLog, clearLog, setUserEmails, setCurrenHead, setStoragePayload, resetBranchDifferences } from "../state/gitpayload";
import { GitHubUser, branch, commitChange, gitActionDispatch, statusMatrixType, gitState, branchDifference, remote, gitLog, fileStatusResult, customGitApi, IGitApi, cloneInputType, fetchInputType, pullInputType, pushInputType, checkoutInput, rmInput, addInput, repository, userEmails, storage } from '../types';
import { removeSlash } from "../utils";
import { disableCallBacks, enableCallBacks } from "./listeners";
@ -784,7 +784,10 @@ export const getBranchDifferences = async (branch: branch, remote: remote, state
remote = state.remotes[0]
}
}
if (!remote) return
if (!remote) {
dispatch(resetBranchDifferences())
return
}
try {
const branchDifference: branchDifference = await plugin.call('dgitApi', 'compareBranches', {

@ -34,6 +34,7 @@ export interface ActionPayloadTypes {
remote: remote
branchDifference: branchDifference
}
RESET_BRANCH_DIFFERENCES: null
SET_GITHUB_USER: GitHubUser
SET_RATE_LIMIT: any
SET_GITHUB_ACCESS_TOKEN: string

@ -192,6 +192,12 @@ export const setBranchDifferences = ({
}
}
export const resetBranchDifferences = () => {
return {
type: 'RESET_BRANCH_DIFFERENCES'
}
}
export const setGItHubToken = (token: string) => {
return {
type: 'SET_GITHUB_ACCESS_TOKEN',

@ -156,6 +156,12 @@ export const gitReducer = (state: gitState = defaultGitState, action: Actions):
branchDifferences: { ...state.branchDifferences }
}
case 'RESET_BRANCH_DIFFERENCES':
return {
...state,
branchDifferences: {}
}
case 'SET_GITHUB_USER':
return {
...state,

Loading…
Cancel
Save