Skip to content

Commit ab9d0eb

Browse files
committed
Renames getLogCommit to getLogCommitForFile
Adds new getLogCommit Adds getRecentLogCommitForFile Renames getLogForRepo to getLog Renames getLogForRepoSearch to getLogForSearch
1 parent 395da8e commit ab9d0eb

20 files changed

+50
-47
lines changed

src/annotations/blameAnnotationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
114114
// Get the full commit message -- since blame only returns the summary
115115
let logCommit: GitCommit | undefined = undefined;
116116
if (!commit.isUncommitted) {
117-
logCommit = await Container.git.getLogCommit(commit.repoPath, commit.uri.fsPath, commit.sha);
117+
logCommit = await Container.git.getLogCommitForFile(commit.repoPath, commit.uri.fsPath, { ref: commit.sha });
118118
if (logCommit !== undefined) {
119119
// Preserve the previous commit from the blame commit
120120
logCommit.previousFileName = commit.previousFileName;

src/annotations/recentChangesAnnotationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
2525
async onProvideAnnotation(shaOrLine?: string | number): Promise<boolean> {
2626
this.annotationType = FileAnnotationType.RecentChanges;
2727

28-
const commit = await Container.git.getLogCommit(this._uri.repoPath, this._uri.fsPath, { previous: true });
28+
const commit = await Container.git.getRecentLogCommitForFile(this._uri.repoPath, this._uri.fsPath);
2929
if (commit === undefined) return false;
3030

3131
const diff = await Container.git.getDiffForFile(this._uri, commit.previousSha);

src/commands/copyMessageToClipboard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
3939
const repoPath = await Container.git.getActiveRepoPath(editor);
4040
if (!repoPath) return undefined;
4141

42-
const log = await Container.git.getLogForRepo(repoPath, { maxCount: 1 });
42+
const log = await Container.git.getLog(repoPath, { maxCount: 1 });
4343
if (!log) return undefined;
4444

4545
args.message = Iterables.first(log.commits.values()).message;
@@ -74,7 +74,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
7474
}
7575

7676
// Get the full commit message -- since blame only returns the summary
77-
const commit = await Container.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, args.sha);
77+
const commit = await Container.git.getLogCommit(gitUri.repoPath!, args.sha);
7878
if (commit === undefined) return undefined;
7979

8080
args.message = commit.message;

src/commands/copyShaToClipboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
3838
const repoPath = await Container.git.getActiveRepoPath(editor);
3939
if (!repoPath) return undefined;
4040

41-
const log = await Container.git.getLogForRepo(repoPath, { maxCount: 1 });
41+
const log = await Container.git.getLog(repoPath, { maxCount: 1 });
4242
if (!log) return undefined;
4343

4444
args.sha = Iterables.first(log.commits.values()).sha;

src/commands/diffWithWorking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
6060
}
6161

6262
try {
63-
args.commit = await Container.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { firstIfMissing: true });
63+
args.commit = await Container.git.getLogCommitForFile(gitUri.repoPath, gitUri.fsPath, { ref: gitUri.sha, firstIfNotFound: true });
6464
if (args.commit === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
6565
}
6666
catch (ex) {

src/commands/showCommitSearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class ShowCommitSearchCommand extends ActiveEditorCachedCommand {
114114

115115
const progressCancellation = CommitsQuickPick.showProgress(searchLabel!);
116116
try {
117-
const log = await Container.git.getLogForRepoSearch(repoPath, args.search, args.searchBy, { maxCount: args.maxCount });
117+
const log = await Container.git.getLogForSearch(repoPath, args.search, args.searchBy, { maxCount: args.maxCount });
118118

119119
if (progressCancellation.token.isCancellationRequested) return undefined;
120120

src/commands/showQuickBranchHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class ShowQuickBranchHistoryCommand extends ActiveEditorCachedCommand {
5252
}
5353

5454
if (args.log === undefined) {
55-
args.log = await Container.git.getLogForRepo(repoPath, { maxCount: args.maxCount, ref: (gitUri && gitUri.sha) || args.branch });
55+
args.log = await Container.git.getLog(repoPath, { maxCount: args.maxCount, ref: (gitUri && gitUri.sha) || args.branch });
5656
if (args.log === undefined) return window.showWarningMessage(`Unable to show branch history`);
5757
}
5858

src/commands/showQuickCommitDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCachedCommand {
9292
}
9393

9494
if (args.repoLog === undefined) {
95-
const log = await Container.git.getLogForRepo(repoPath!, { maxCount: 2, ref: args.sha });
95+
const log = await Container.git.getLog(repoPath!, { maxCount: 2, ref: args.sha });
9696
if (log === undefined) return Messages.showCommitNotFoundWarningMessage(`Unable to show commit details`);
9797

9898
args.commit = log.commits.get(args.sha!);

src/commands/showQuickCommitFileDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
9494
}
9595

9696
if (args.fileLog === undefined) {
97-
args.commit = await Container.git.getLogCommit(args.commit === undefined ? gitUri.repoPath : args.commit.repoPath, gitUri.fsPath, args.sha, { previous: true });
97+
args.commit = await Container.git.getLogCommitForFile(args.commit === undefined ? gitUri.repoPath : args.commit.repoPath, gitUri.fsPath, { ref: args.sha });
9898
if (args.commit === undefined) return Messages.showCommitNotFoundWarningMessage(`Unable to show commit file details`);
9999
}
100100
}

src/currentLineController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class CurrentLineController extends Disposable {
257257
// Get the full commit message -- since blame only returns the summary
258258
let logCommit = this._lineTracker.state !== undefined ? this._lineTracker.state.logCommit : undefined;
259259
if (logCommit === undefined && !commit.isUncommitted) {
260-
logCommit = await Container.git.getLogCommit(commit.repoPath, commit.uri.fsPath, commit.sha);
260+
logCommit = await Container.git.getLogCommitForFile(commit.repoPath, commit.uri.fsPath, { ref: commit.sha });
261261
if (logCommit !== undefined) {
262262
// Preserve the previous commit from the blame commit
263263
logCommit.previousSha = commit.previousSha;

0 commit comments

Comments
 (0)