mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
timeline: use follow option so timeline follow file beyond renames (#187174)
feat(git): use follow option so timeline follow file beyond renames Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
This commit is contained in:
parent
5bf577b08a
commit
bef295a70b
|
@ -50,6 +50,8 @@ interface MutableRemote extends Remote {
|
|||
* Log file options.
|
||||
*/
|
||||
export interface LogFileOptions {
|
||||
/** Optional. Continue listing the history of a file beyond renames */
|
||||
readonly follow?: boolean;
|
||||
/** Optional. The maximum number of log entries to retrieve. */
|
||||
readonly maxEntries?: number | string;
|
||||
/** Optional. The Git sha (hash) to start retrieving log entries from. */
|
||||
|
@ -1091,6 +1093,10 @@ export class Repository {
|
|||
args.push('--author-date-order');
|
||||
}
|
||||
|
||||
if (options?.follow) {
|
||||
args.push('--follow');
|
||||
}
|
||||
|
||||
args.push('--', uri.fsPath);
|
||||
|
||||
const result = await this.exec(args);
|
||||
|
|
|
@ -152,6 +152,7 @@ export class GitTimelineProvider implements TimelineProvider {
|
|||
const commits = await repo.logFile(uri, {
|
||||
maxEntries: limit,
|
||||
hash: options.cursor,
|
||||
follow: true,
|
||||
// sortByAuthorDate: true
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue