Skip to content

Commit f394740

Browse files
committed
rebase, lint & code fixes
1 parent 0c269b3 commit f394740

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17905,35 +17905,35 @@
1790517905
"build:extension": "webpack --mode development --config-name extension:node",
1790617906
"build:extension:browser": "webpack --mode development --config-name extension:webworker",
1790717907
"build:webviews": "webpack --mode development --config-name webviews",
17908-
"build:icons": "pnpm run icons:svgo && pnpm run fantasticon && pnpm run icons:apply",
17908+
"build:icons": "npm run icons:svgo && npm run fantasticon && npm run icons:apply",
1790917909
"build:tests": "node ./scripts/esbuild.tests.mjs --mode development",
1791017910
"generate:docs:telemetry": "node ./scripts/generate-telemetry-docs.mjs",
1791117911
"bundle": "webpack --mode production",
1791217912
"bundle:extension": "webpack --mode production --config-name extension:node",
1791317913
"clean": "pnpx rimraf --glob dist out .vscode-test .vscode-test-web .eslintcache* tsconfig*.tsbuildinfo",
17914-
"clean:all": "pnpm run clean && pnpm run clean:deps",
17914+
"clean:all": "npm run clean && npm run clean:deps",
1791517915
"clean:lint": "pnpx rimraf .eslintcache",
1791617916
"clean:deps": "pnpx rimraf node_modules",
1791717917
"copy:images": "webpack --config webpack.config.images.mjs",
17918-
"graph:link": "pnpm link @gitkraken/gitkraken-components",
17919-
"graph:link:main": "pushd \"../GitKrakenComponents\" && pnpm link && popd && pnpm graph:link",
17920-
"graph:unlink": "pnpm unlink @gitkraken/gitkraken-components && pnpm install --force",
17921-
"graph:unlink:main": "pnpm graph:unlink && pushd \"../GitKrakenComponents\" && pnpm unlink && popd",
17918+
"graph:link": "npm link @gitkraken/gitkraken-components",
17919+
"graph:link:main": "pushd \"../GitKrakenComponents\" && npm link && popd && npm graph:link",
17920+
"graph:unlink": "npm unlink @gitkraken/gitkraken-components && npm install --force",
17921+
"graph:unlink:main": "npm graph:unlink && pushd \"../GitKrakenComponents\" && npm unlink && popd",
1792217922
"icons:apply": "node ./scripts/applyIconsContribution.mjs",
1792317923
"icons:svgo": "svgo -q -f ./images/icons/ --config svgo.config.js",
17924-
"lint": "pnpm run clean:lint && eslint .",
17925-
"lint:fix": "pnpm run clean:lint && eslint . --fix",
17926-
"lint:webviews": "pnpm run clean:lint && eslint \"src/webviews/apps/**/*.ts?(x)\"",
17924+
"lint": "npm run clean:lint && eslint .",
17925+
"lint:fix": "npm run clean:lint && eslint . --fix",
17926+
"lint:webviews": "npm run clean:lint && eslint \"src/webviews/apps/**/*.ts?(x)\"",
1792717927
"package": "vsce package --no-dependencies",
17928-
"package-pre": "pnpm run patch-pre && pnpm run package --pre-release",
17928+
"package-pre": "npm run patch-pre && npm run package --pre-release",
1792917929
"patch-pre": "node ./scripts/applyPreReleasePatch.mjs",
1793017930
"prep-release": "node ./scripts/prep-release.mjs",
1793117931
"pretty": "prettier --config .prettierrc --write .",
1793217932
"pretty:check": "prettier --config .prettierrc --check .",
1793317933
"pub": "vsce publish --no-dependencies",
1793417934
"pub-pre": "vsce publish --no-dependencies --pre-release",
17935-
"rebuild": "pnpm run reset && pnpm run build",
17936-
"reset": "pnpm run clean && pnpm install --force",
17935+
"rebuild": "npm run reset && npm run build",
17936+
"reset": "npm run clean && npm install --force",
1793717937
"test": "vscode-test",
1793817938
"test:e2e": "playwright test -c tests/e2e/playwright.config.ts",
1793917939
"watch": "webpack --watch --mode development",
@@ -17946,8 +17946,8 @@
1794617946
"update-dts:main": "pushd \"src/@types\" && pnpx @vscode/dts main && popd",
1794717947
"update-emoji": "node ./scripts/generateEmojiShortcodeMap.mjs",
1794817948
"update-licenses": "node ./scripts/generateLicenses.mjs",
17949-
"pretest": "pnpm run build:tests",
17950-
"vscode:prepublish": "pnpm run bundle"
17949+
"pretest": "npm run build:tests",
17950+
"vscode:prepublish": "npm run bundle"
1795117951
},
1795217952
"dependencies": {
1795317953
"@gitkraken/gitkraken-components": "10.7.0",

src/env/node/git/git.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,11 @@ function getStdinUniqueKey(): number {
166166
type ExitCodeOnlyGitCommandOptions = GitCommandOptions & { exitCodeOnly: true };
167167
export type PushForceOptions = { withLease: true; ifIncludes?: boolean } | { withLease: false; ifIncludes?: never };
168168

169-
const branchErrorAndReason = [
169+
const branchErrorAndReason: [RegExp, BranchErrorReason][] = [
170170
[GitErrors.noRemoteReference, BranchErrorReason.NoRemoteReference],
171171
[GitErrors.invalidBranchName, BranchErrorReason.InvalidBranchName],
172172
[GitErrors.branchAlreadyExists, BranchErrorReason.BranchAlreadyExists],
173173
[GitErrors.branchNotFullyMerged, BranchErrorReason.BranchNotFullyMerged],
174-
[GitErrors.branchNotYetBorn, BranchErrorReason.BranchNotYetBorn],
175-
[GitErrors.branchFastForwardRejected, BranchErrorReason.BranchFastForwardRejected],
176174
];
177175

178176
export class Git {

src/env/node/git/localGitProvider.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,25 +1253,25 @@ export class LocalGitProvider implements GitProvider, Disposable {
12531253
}
12541254

12551255
@log()
1256-
createBranch(repoPath: string, name: string, ref: string): Promise<void> {
1256+
async createBranch(repoPath: string, name: string, ref: string): Promise<void> {
12571257
try {
1258-
return void this.git.branch(repoPath, name, ref);
1258+
await this.git.branch(repoPath, name, ref);
12591259
} catch (ex) {
12601260
if (ex instanceof BranchError) {
1261-
throw ex.WithBranch(branch.name);
1261+
throw ex.WithBranch(name);
12621262
}
12631263

12641264
throw ex;
12651265
}
12661266
}
12671267

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

12771277
throw ex;
@@ -1306,7 +1306,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
13061306
}
13071307

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

@@ -1316,8 +1316,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
13161316
await this.git.branch(repoPath, ...args, branch.ref);
13171317
} catch (ex) {
13181318
// If it fails, restore the remote branch
1319-
await this.git.update_ref(repoPath, `refs/remotes/${remote}/${branch.ref}`, commit);
1320-
await this.git.branch__set_upstream(repoPath, branch, remote, branch);
1319+
await this.git.update_ref(repoPath, `refs/remotes/${remote}/${branch.ref}`, remoteCommit?.[0] ?? '');
1320+
await this.git.branch__set_upstream(repoPath, branch.name, remote, branch.ref);
13211321
throw ex;
13221322
}
13231323

0 commit comments

Comments
 (0)