Skip to content

Commit ead29af

Browse files
committed
rebase, lint & code fixes
1 parent 964d3c3 commit ead29af

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

Diff for: package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -4642,23 +4642,22 @@
46424642
"gitlens.advanced.messages": {
46434643
"type": "object",
46444644
"default": {
4645-
"suppressBlameInvalidIgnoreRevsFileBadRevisionWarning": false,
4646-
"suppressBlameInvalidIgnoreRevsFileWarning": false,
46474645
"suppressCommitHasNoPreviousCommitWarning": false,
46484646
"suppressCommitNotFoundWarning": false,
46494647
"suppressCreatePullRequestPrompt": false,
46504648
"suppressDebugLoggingWarning": false,
46514649
"suppressFileNotUnderSourceControlWarning": false,
4652-
"suppressGitBranchNotFullyMergedWarning": false,
46534650
"suppressGitDisabledWarning": false,
46544651
"suppressGitMissingWarning": false,
46554652
"suppressGitVersionWarning": false,
4653+
"suppressLineUncommittedWarning": false,
4654+
"suppressNoRepositoryWarning": false,
4655+
"suppressRebaseSwitchToTextWarning": false,
46564656
"suppressIntegrationDisconnectedTooManyFailedRequestsWarning": false,
46574657
"suppressIntegrationRequestFailed500Warning": false,
46584658
"suppressIntegrationRequestTimedOutWarning": false,
4659-
"suppressLineUncommittedWarning": false,
4660-
"suppressNoRepositoryWarning": false,
4661-
"suppressRebaseSwitchToTextWarning": false
4659+
"suppressBlameInvalidIgnoreRevsFileWarning": false,
4660+
"suppressBlameInvalidIgnoreRevsFileBadRevisionWarning": false
46624661
},
46634662
"properties": {
46644663
"suppressCommitHasNoPreviousCommitWarning": {

Diff for: src/env/node/git/git.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,11 @@ function getStdinUniqueKey(): number {
171171
type ExitCodeOnlyGitCommandOptions = GitCommandOptions & { exitCodeOnly: true };
172172
export type PushForceOptions = { withLease: true; ifIncludes?: boolean } | { withLease: false; ifIncludes?: never };
173173

174-
const branchErrorAndReason = [
174+
const branchErrorAndReason: [RegExp, BranchErrorReason][] = [
175175
[GitErrors.noRemoteReference, BranchErrorReason.NoRemoteReference],
176176
[GitErrors.invalidBranchName, BranchErrorReason.InvalidBranchName],
177177
[GitErrors.branchAlreadyExists, BranchErrorReason.BranchAlreadyExists],
178178
[GitErrors.branchNotFullyMerged, BranchErrorReason.BranchNotFullyMerged],
179-
[GitErrors.branchNotYetBorn, BranchErrorReason.BranchNotYetBorn],
180-
[GitErrors.branchFastForwardRejected, BranchErrorReason.BranchFastForwardRejected],
181179
];
182180

183181
const tagErrorAndReason: [RegExp, TagErrorReason][] = [

Diff for: src/env/node/git/localGitProvider.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1256,25 +1256,25 @@ export class LocalGitProvider implements GitProvider, Disposable {
12561256
}
12571257

12581258
@log()
1259-
createBranch(repoPath: string, name: string, ref: string): Promise<void> {
1259+
async createBranch(repoPath: string, name: string, ref: string): Promise<void> {
12601260
try {
1261-
return void this.git.branch(repoPath, name, ref);
1261+
await this.git.branch(repoPath, name, ref);
12621262
} catch (ex) {
12631263
if (ex instanceof BranchError) {
1264-
throw ex.WithBranch(branch.name);
1264+
throw ex.WithBranch(name);
12651265
}
12661266

12671267
throw ex;
12681268
}
12691269
}
12701270

12711271
@log()
1272-
renameBranch(repoPath: string, oldName: string, newName: string): Promise<void> {
1272+
async renameBranch(repoPath: string, oldName: string, newName: string): Promise<void> {
12731273
try {
1274-
return void this.git.branch(repoPath, '-m', oldName, newName);
1274+
await this.git.branch(repoPath, '-m', oldName, newName);
12751275
} catch (ex) {
12761276
if (ex instanceof BranchError) {
1277-
throw ex.WithBranch(branch.name);
1277+
throw ex.WithBranch(oldName);
12781278
}
12791279

12801280
throw ex;
@@ -1309,7 +1309,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
13091309
}
13101310

13111311
const remote = getRemoteNameFromBranchName(branch.upstream.name);
1312-
remoteCommit = await this.git.rev_list(repoPath, `refs/remotes/${remote}/${branch.ref}`, {
1312+
const remoteCommit = await this.git.rev_list(repoPath, `refs/remotes/${remote}/${branch.ref}`, {
13131313
maxResults: 1,
13141314
});
13151315

@@ -1319,8 +1319,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
13191319
await this.git.branch(repoPath, ...args, branch.ref);
13201320
} catch (ex) {
13211321
// If it fails, restore the remote branch
1322-
await this.git.update_ref(repoPath, `refs/remotes/${remote}/${branch.ref}`, commit);
1323-
await this.git.branch__set_upstream(repoPath, branch, remote, branch);
1322+
await this.git.update_ref(repoPath, `refs/remotes/${remote}/${branch.ref}`, remoteCommit?.[0] ?? '');
1323+
await this.git.branch__set_upstream(repoPath, branch.name, remote, branch.ref);
13241324
throw ex;
13251325
}
13261326

Diff for: src/git/models/repository.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ import { configuration } from '../../system/vscode/configuration';
2626
import type { GitProviderDescriptor, GitProviderRepository } from '../gitProvider';
2727
import type { GitProviderService } from '../gitProviderService';
2828
import type { GitBranch } from './branch';
29-
import type { GitBranchReference, GitReference, GitTagReference } from './reference';
30-
import { getNameWithoutRemote, isBranchReference } from './reference';
31-
import { getBranchNameWithoutRemote, getRemoteNameFromBranchName } from './branch';
29+
import type { GitBranchReference, GitReference } from './reference';
30+
import { isBranchReference } from './reference';
3231
import type { GitRemote } from './remote';
3332
import type { GitWorktree } from './worktree';
3433

0 commit comments

Comments
 (0)