mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Git - add git.commitShortHashLength setting (#237343)
This commit is contained in:
@@ -23,7 +23,7 @@ import { IPushErrorHandlerRegistry } from './pushError';
|
||||
import { IRemoteSourcePublisherRegistry } from './remotePublisher';
|
||||
import { StatusBarCommands } from './statusbar';
|
||||
import { toGitUri } from './uri';
|
||||
import { anyEvent, combinedDisposable, debounceEvent, dispose, EmptyDisposable, eventToPromise, filterEvent, find, IDisposable, isDescendant, onceEvent, pathEquals, relativePath } from './util';
|
||||
import { anyEvent, combinedDisposable, debounceEvent, dispose, EmptyDisposable, eventToPromise, filterEvent, find, getCommitShortHash, IDisposable, isDescendant, onceEvent, pathEquals, relativePath } from './util';
|
||||
import { IFileWatcher, watch } from './watch';
|
||||
import { detectEncoding } from './encoding';
|
||||
|
||||
@@ -1657,7 +1657,7 @@ export class Repository implements Disposable {
|
||||
}
|
||||
|
||||
async checkout(treeish: string, opts?: { detached?: boolean; pullBeforeCheckout?: boolean }): Promise<void> {
|
||||
const refLabel = opts?.detached ? treeish.substring(0, 8) : treeish;
|
||||
const refLabel = opts?.detached ? getCommitShortHash(Uri.file(this.root), treeish) : treeish;
|
||||
|
||||
await this.run(Operation.Checkout(refLabel),
|
||||
async () => {
|
||||
@@ -1675,7 +1675,7 @@ export class Repository implements Disposable {
|
||||
}
|
||||
|
||||
async checkoutTracking(treeish: string, opts: { detached?: boolean } = {}): Promise<void> {
|
||||
const refLabel = opts.detached ? treeish.substring(0, 8) : treeish;
|
||||
const refLabel = opts.detached ? getCommitShortHash(Uri.file(this.root), treeish) : treeish;
|
||||
await this.run(Operation.CheckoutTracking(refLabel), () => this.repository.checkout(treeish, [], { ...opts, track: true }));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user