瀏覽代碼

Fixes stashes display without a message

Adds parents to stash commits

Co-authored-by: Ramin Tadayon <ramin.tadayon@gitkraken.com>
main
Eric Amodio 2 年之前
父節點
當前提交
96b88e1fda
共有 2 個檔案被更改,包括 13 行新增10 行删除
  1. +1
    -0
      CHANGELOG.md
  2. +12
    -10
      src/env/node/git/localGitProvider.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -47,6 +47,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes [#2082](https://github.com/gitkraken/vscode-gitlens/issues/2082) - GitLens Home view unreadable in certain themes
- Fixes [#2070](https://github.com/gitkraken/vscode-gitlens/issues/2070) - Quoted HTML / JSX syntax is not escaped correctly
- Fixes [#2069](https://github.com/gitkraken/vscode-gitlens/issues/2069) - Heatmap - incorrect behavior of gitlens.heatmap.fadeLines with gitlens.heatmap.ageThreshold
- Fixes an issue where stashes without a message aren't displayed properly
- Fixes an issue where the _Stashes_ view empty state isn't displayed properly when there are no stashes
- Fixes typos via [PR #2086](https://github.com/gitkraken/vscode-gitlens/pull/2086) by stampyzfanz ([@stampyzfanz](https://github.com/stampyzfanz)), and [PR #2043](https://github.com/gitkraken/vscode-gitlens/pull/2043), [PR #2040](https://github.com/gitkraken/vscode-gitlens/pull/2040), [PR #2042](https://github.com/gitkraken/vscode-gitlens/pull/2042) by jogo- ([@jogo-](https://github.com/jogo-))

+ 12
- 10
src/env/node/git/localGitProvider.ts 查看文件

@ -3283,12 +3283,14 @@ export class LocalGitProvider implements GitProvider, Disposable {
sha: string;
date: string;
committedDate: string;
parents: string;
stashName: string;
summary: string;
}>({
sha: '%H',
date: '%at',
committedDate: '%ct',
parents: '%P',
stashName: '%gd',
summary: '%B',
});
@ -3304,19 +3306,21 @@ export class LocalGitProvider implements GitProvider, Disposable {
let onRef;
let summary;
let message;
const match = stashSummaryRegex.exec(s.summary);
if (match?.groups != null) {
onRef = match.groups.onref;
if (match.groups.wip) {
message = `WIP: ${match.groups.summary.trim()}`;
summary = `WIP on ${onRef}`;
summary = match.groups.summary.trim();
if (summary.length === 0) {
message = 'WIP';
} else if (match.groups.wip) {
message = `WIP: ${summary}`;
} else {
message = match.groups.summary.trim();
summary = message.split('\n', 1)[0] ?? '';
message = summary;
}
} else {
message = s.summary.trim();
summary = message.split('\n', 1)[0] ?? '';
}
commits.set(
@ -3327,8 +3331,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
s.sha,
new GitCommitIdentity('You', undefined, new Date((s.date as any) * 1000)),
new GitCommitIdentity('You', undefined, new Date((s.committedDate as any) * 1000)),
summary,
[],
message.split('\n', 1)[0] ?? '',
s.parents.split(' '),
message,
s.files?.map(
f => new GitFileChange(repoPath, f.path, f.status as GitFileStatus, f.originalPath),
@ -3343,8 +3347,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
stash = { repoPath: repoPath, commits: commits };
// sw.stop();
if (this.useCaching) {
this._stashesCache.set(repoPath, stash ?? null);
}

Loading…
取消
儲存