feat: Redesign git changes to split stage/unstaged files. (#1359)
* feat: Redesign git changes to split stage/unstaged files. Signed-off-by: Paolo Insogna <paolo@cowtech.it> * fixup Signed-off-by: Paolo Insogna <paolo@cowtech.it> * fixup Signed-off-by: Paolo Insogna <paolo@cowtech.it> * refactor: streamline git changes panel * fix: label staged and working diff tabs * fix: isolate staged and working diff files * fix: scope staged and working diff updates * fix: scope git row revert to working changes --------- Signed-off-by: Paolo Insogna <paolo@cowtech.it> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
9af0de0056
commit
e16097b05d
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { resolveBaseRefForLog } from './service.js';
|
||||
import { resolveBaseRefForLog, stageFiles, unstageFiles } from './service.js';
|
||||
|
||||
describe('resolveBaseRefForLog', () => {
|
||||
it('returns the local ref unchanged when it exists, even if origin also exists', async () => {
|
||||
@@ -37,3 +37,13 @@ describe('resolveBaseRefForLog', () => {
|
||||
expect(await resolveBaseRefForLog(' ', checkRef)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('git index path validation', () => {
|
||||
it('rejects stage paths outside the repository before invoking git', async () => {
|
||||
await expect(stageFiles('/repo', ['../secret.txt'])).rejects.toThrow('Path is outside repository: ../secret.txt');
|
||||
});
|
||||
|
||||
it('rejects unstage paths outside the repository before invoking git', async () => {
|
||||
await expect(unstageFiles('/repo', ['../secret.txt'])).rejects.toThrow('Path is outside repository: ../secret.txt');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user