|
|
@ -6,6 +6,8 @@ import GitUIButton from "../buttons/gituibutton"; |
|
|
|
import { gitPluginContext } from "../gitui"; |
|
|
|
import { gitPluginContext } from "../gitui"; |
|
|
|
import { LocalBranchDetails } from "./branches/localbranchdetails"; |
|
|
|
import { LocalBranchDetails } from "./branches/localbranchdetails"; |
|
|
|
import { RemoteBranchDetails } from "./branches/remotebranchedetails"; |
|
|
|
import { RemoteBranchDetails } from "./branches/remotebranchedetails"; |
|
|
|
|
|
|
|
import { faSync } from "@fortawesome/free-solid-svg-icons"; |
|
|
|
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
|
|
|
|
|
|
|
|
|
|
|
export const Branches = () => { |
|
|
|
export const Branches = () => { |
|
|
|
const context = React.useContext(gitPluginContext) |
|
|
|
const context = React.useContext(gitPluginContext) |
|
|
@ -31,11 +33,16 @@ export const Branches = () => { |
|
|
|
{context.upstream ? |
|
|
|
{context.upstream ? |
|
|
|
<> |
|
|
|
<> |
|
|
|
<label className="text-uppercase">remote branches on {context.upstream ? context.upstream.name : null}</label> |
|
|
|
<label className="text-uppercase">remote branches on {context.upstream ? context.upstream.name : null}</label> |
|
|
|
{context.branches && context.branches.filter((branch, index) => branch.remote && branch.remote.name === context.upstream.name ).map((branch, index) => { |
|
|
|
{context.branches && context.branches.filter((branch, index) => branch.remote && branch.remote.name === context.upstream.name).map((branch, index) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<RemoteBranchDetails key={index} branch={branch}></RemoteBranchDetails> |
|
|
|
<RemoteBranchDetails key={index} branch={branch}></RemoteBranchDetails> |
|
|
|
); |
|
|
|
); |
|
|
|
})} |
|
|
|
})} |
|
|
|
|
|
|
|
<GitUIButton data-id={`remote-sync-${context.upstream.name}`} className="btn btn-sm" onClick={async () => { |
|
|
|
|
|
|
|
await actions.fetch({ |
|
|
|
|
|
|
|
remote: context.upstream |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}}><FontAwesomeIcon icon={faSync} ></FontAwesomeIcon><label className="pl-1">Fetch more from remote</label></GitUIButton> |
|
|
|
<hr /></> : null} |
|
|
|
<hr /></> : null} |
|
|
|
|
|
|
|
|
|
|
|
</div> : null} |
|
|
|
</div> : null} |
|
|
|