mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Enable the .. argument for git log (#188500)
* Enable the `..` argument for git log This will return the commits that the `toRef` has but the `fromRef` does not. * Use range instead
This commit is contained in:
Vendored
+2
@@ -129,6 +129,8 @@ export interface LogOptions {
|
||||
/** Max number of log entries to retrieve. If not specified, the default is 32. */
|
||||
readonly maxEntries?: number;
|
||||
readonly path?: string;
|
||||
/** A commit range, such as "0a47c67f0fb52dd11562af48658bc1dff1d75a38..0bb4bdea78e1db44d728fd6894720071e303304f" */
|
||||
readonly range?: string;
|
||||
}
|
||||
|
||||
export interface CommitOptions {
|
||||
|
||||
@@ -1022,7 +1022,14 @@ export class Repository {
|
||||
|
||||
async log(options?: LogOptions): Promise<Commit[]> {
|
||||
const maxEntries = options?.maxEntries ?? 32;
|
||||
const args = ['log', `-n${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z', '--'];
|
||||
const args = ['log', `-n${maxEntries}`, `--format=${COMMIT_FORMAT}`, '-z'];
|
||||
|
||||
if (options?.range) {
|
||||
args.push(options.range);
|
||||
}
|
||||
|
||||
args.push('--');
|
||||
|
||||
if (options?.path) {
|
||||
args.push(options.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user