Skip to content

Commit 6249eb7

Browse files
committed
Exposes native git setting properly
1 parent bc05de1 commit 6249eb7

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,6 +3831,13 @@
38313831
"scope": "window",
38323832
"order": 110
38333833
},
3834+
"gitlens.experimental.nativeGit": {
3835+
"type": "boolean",
3836+
"default": false,
3837+
"markdownDescription": "(Experimental) Specifies whether to use Git directly for fetch/push/pull operation instead of relying on VS Code's built-in Git implementation",
3838+
"scope": "window",
3839+
"order": 120
3840+
},
38343841
"gitlens.advanced.useSymmetricDifferenceNotation": {
38353842
"deprecationMessage": "Deprecated. This setting is no longer used",
38363843
"markdownDescription": "Deprecated. This setting is no longer used"

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export interface Config {
6363
detectNestedRepositories: boolean;
6464
experimental: {
6565
generateCommitMessagePrompt: string;
66+
nativeGit: boolean;
6667
};
6768
fileAnnotations: {
6869
command: string | null;

src/env/node/git/localGitProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
344344
if (scmGit == null) return;
345345

346346
// Find env to pass to Git
347-
if (configuration.getAny('gitlens.experimental.nativeGit') === true) {
347+
if (configuration.get('experimental.nativeGit') === true) {
348348
for (const v of Object.values(scmGit.git)) {
349349
if (v != null && typeof v === 'object' && 'git' in v) {
350350
for (const vv of Object.values(v.git)) {

src/git/models/repository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ export class Repository implements Disposable {
574574
remote?: string;
575575
}) {
576576
try {
577-
if (configuration.getAny('gitlens.experimental.nativeGit') === true || options?.branch != null) {
577+
if (configuration.get('experimental.nativeGit') === true || options?.branch != null) {
578578
await this.container.git.fetch(this.path, options);
579579
} else {
580580
void (await executeCoreGitCommand('git.fetch', this.path));
@@ -793,7 +793,7 @@ export class Repository implements Disposable {
793793

794794
private async pullCore(options?: { rebase?: boolean }) {
795795
try {
796-
if (configuration.getAny('gitlens.experimental.nativeGit') === true) {
796+
if (configuration.get('experimental.nativeGit') === true) {
797797
const withTags = configuration.getAny<CoreGitConfiguration, boolean>(
798798
'git.pullTags',
799799
Uri.file(this.path),
@@ -884,7 +884,7 @@ export class Repository implements Disposable {
884884
};
885885
}) {
886886
try {
887-
if (configuration.getAny('gitlens.experimental.nativeGit') === true) {
887+
if (configuration.get('experimental.nativeGit') === true) {
888888
const branch = await this.getBranch(options?.reference?.name);
889889
await this.container.git.push(this.path, {
890890
force: options?.force,

0 commit comments

Comments
 (0)