Skip to content

Commit

Permalink
fix: addressing review comments
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
tegefaulkes committed May 20, 2024
1 parent 412936b commit 7df974f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/vaults/VaultInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,12 @@ class VaultInternal {
[
["a.txt", 0, 2, 0], // new, untracked
["b.txt", 0, 2, 2], // added, staged
["c.txt", 0, 2, 3], // added, staged, with unStaged changes
["c.txt", 0, 2, 3], // added, staged, with unstaged changes
["d.txt", 1, 1, 1], // unmodified
["e.txt", 1, 2, 1], // modified, unStaged
["e.txt", 1, 2, 1], // modified, unstaged
["f.txt", 1, 2, 2], // modified, staged
["g.txt", 1, 2, 3], // modified, staged, with unStaged changes
["h.txt", 1, 0, 1], // deleted, unStaged
["g.txt", 1, 2, 3], // modified, staged, with unstaged changes
["h.txt", 1, 0, 1], // deleted, unstaged
["i.txt", 1, 0, 0], // deleted, staged
]
```
Expand Down
6 changes: 3 additions & 3 deletions src/vaults/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ async function* readDirRecursively(
fs,
dir = '.',
): AsyncGenerator<string, void, void> {
const dirEntities = await fs.promises.readdir(dir);
for (const dirent of dirEntities) {
const res = path.join(dir, dirent.toString());
const dirEntries = await fs.promises.readdir(dir);
for (const dirEntry of dirEntries) {
const res = path.join(dir, dirEntry.toString());
const stat = await fs.promises.stat(res);
if (stat.isDirectory()) {
yield* readDirRecursively(fs, res);
Expand Down
2 changes: 0 additions & 2 deletions tests/vaults/VaultOps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ describe('VaultOps', () => {
);
});
});
// TODO: fix this up. it's an annoying test
describe('addSecretDirectory', () => {
test('adding a directory of 1 secret', async () => {
const secretDir = await fs.promises.mkdtemp(
Expand Down Expand Up @@ -476,7 +475,6 @@ describe('VaultOps', () => {
expect(secretList).toHaveLength(0);
});
});
// Not sure if hidden file names are a special case, but I'm keeping the tests just in case
test('adding hidden files and directories', async () => {
await vaultOps.addSecret(vault, '.hiddenSecret', 'hidden_contents');
await vaultOps.mkdir(vault, '.hiddenDir', { recursive: true });
Expand Down

0 comments on commit 7df974f

Please sign in to comment.