mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Checkout branch with "force" so it updates the tree
This commit is contained in:
4 files changed
+6
No files matched your search
@@ -135,6 +135,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
|
|||||||
await git.checkout({
|
await git.checkout({
|
||||||
dir: projectPath,
|
dir: projectPath,
|
||||||
ref: branchName,
|
ref: branchName,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
@@ -1125,6 +1126,7 @@ export function GitDialog({ projectId, children, open, onOpenChange }: GitDialog
|
|||||||
await git.checkout({
|
await git.checkout({
|
||||||
dir: projectPath,
|
dir: projectPath,
|
||||||
ref: pr.sourceBranch,
|
ref: pr.sourceBranch,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
await refetchGitStatus();
|
await refetchGitStatus();
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ export function BranchManager({ projectId, currentBranch, onBranchChange }: Bran
|
|||||||
await git.checkout({
|
await git.checkout({
|
||||||
dir: projectPath,
|
dir: projectPath,
|
||||||
ref: branchName,
|
ref: branchName,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ export class GitCheckoutCommand implements GitSubcommand {
|
|||||||
await this.git.checkout({
|
await this.git.checkout({
|
||||||
dir: this.pwd,
|
dir: this.pwd,
|
||||||
ref: branchName,
|
ref: branchName,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
return createSuccessResult(`Switched to branch '${branchName}'\n`);
|
return createSuccessResult(`Switched to branch '${branchName}'\n`);
|
||||||
@@ -168,6 +169,7 @@ export class GitCheckoutCommand implements GitSubcommand {
|
|||||||
await this.git.checkout({
|
await this.git.checkout({
|
||||||
dir: this.pwd,
|
dir: this.pwd,
|
||||||
ref: branchName,
|
ref: branchName,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
return createSuccessResult(`Switched to a new branch '${branchName}'\n`);
|
return createSuccessResult(`Switched to a new branch '${branchName}'\n`);
|
||||||
|
|||||||
@@ -1066,6 +1066,7 @@ export class Git {
|
|||||||
fs: this.fs,
|
fs: this.fs,
|
||||||
dir: options.dir,
|
dir: options.dir,
|
||||||
ref: expectedBranch,
|
ref: expectedBranch,
|
||||||
|
force: true,
|
||||||
});
|
});
|
||||||
} catch (checkoutError) {
|
} catch (checkoutError) {
|
||||||
console.warn(`Failed to checkout branch ${expectedBranch}:`, checkoutError);
|
console.warn(`Failed to checkout branch ${expectedBranch}:`, checkoutError);
|
||||||
|
|||||||
Reference in new issue
Block a user