mirror of
https://github.com/kahole/edamagit.git
synced 2024-09-11 07:15:31 +03:00
Compare commits
2 Commits
6d4125795e
...
7d575c50be
Author | SHA1 | Date | |
---|---|---|---|
|
7d575c50be | ||
|
d438b66fd8 |
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## [0.6.54]
|
||||
- Fixes "visit change" for commit and stash detail views
|
||||
|
||||
## [0.6.51]
|
||||
- Make commit and stash detail view update on changes (fixes #282)
|
||||
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "magit",
|
||||
"version": "0.6.53",
|
||||
"version": "0.6.54",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "magit",
|
||||
"version": "0.6.53",
|
||||
"version": "0.6.54",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vscode/iconv-lite-umd": "^0.7.0",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"author": {
|
||||
"name": "Kristian Andersen Hole"
|
||||
},
|
||||
"version": "0.6.53",
|
||||
"version": "0.6.54",
|
||||
"engines": {
|
||||
"vscode": "^1.50.0"
|
||||
},
|
||||
|
@ -104,7 +104,7 @@ async function showStash({ repository }: MenuState) {
|
||||
}
|
||||
}
|
||||
|
||||
export function stashToMagitChanges(nameStatusText: string, diff: string): MagitChange[] {
|
||||
export function stashToMagitChanges(repository: MagitRepository, nameStatusText: string, diff: string): MagitChange[] {
|
||||
const DIFF_PREFIX = 'diff --git';
|
||||
const filesWithStatus = nameStatusText.split(Constants.LineSplitterRegex).filter(t => t !== '').map(s => s.split('\t'));
|
||||
const diffs = diff.split(DIFF_PREFIX).filter(r => r !== '');
|
||||
@ -115,7 +115,7 @@ export function stashToMagitChanges(nameStatusText: string, diff: string): Magit
|
||||
|
||||
return diffs.map((diff, idx) => {
|
||||
const [status, ...paths] = filesWithStatus[idx];
|
||||
const uri = Uri.file(paths[paths.length - 1]);
|
||||
const uri = Uri.from({ ...repository.gitRepository.rootUri, path: repository.gitRepository.rootUri.path + '/' + paths[paths.length - 1] });
|
||||
const fileStatus = getStatusFromString(status);
|
||||
return {
|
||||
diff,
|
||||
@ -171,7 +171,7 @@ export async function showStashDetail(repository: MagitRepository, stash: Stash)
|
||||
const nameStatusText = (await nameStatusTask).stdout;
|
||||
const stashDiff = (await stashShowTask).stdout;
|
||||
|
||||
return ViewUtils.showView(uri, new StashDetailView(uri, stash, stashToMagitChanges(nameStatusText, stashDiff), stashUntrackedFiles));
|
||||
return ViewUtils.showView(uri, new StashDetailView(uri, stash, stashToMagitChanges(repository, nameStatusText, stashDiff), stashUntrackedFiles));
|
||||
}
|
||||
|
||||
async function showCommit({ repository }: MenuState) {
|
||||
|
@ -148,5 +148,5 @@ export async function visitCommit(repository: MagitRepository, commitHash: strin
|
||||
const commit: MagitCommit = { hash: commitHash, message: '', parents: [] };
|
||||
|
||||
const uri = CommitDetailView.encodeLocation(repository, commit.hash);
|
||||
return ViewUtils.showView(uri, new CommitDetailView(uri, commit, header.stdout, stashToMagitChanges(nameStatus.stdout, diffs.stdout)));
|
||||
return ViewUtils.showView(uri, new CommitDetailView(uri, commit, header.stdout, stashToMagitChanges(repository, nameStatus.stdout, diffs.stdout)));
|
||||
}
|
Loading…
Reference in New Issue
Block a user