Skip to content

Commit

Permalink
fix: nested git repos not showing up in source control view
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Dec 13, 2020
1 parent 6da3973 commit 37adc5e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/engine-server/src/workspace.ts
Expand Up @@ -104,7 +104,7 @@ export class WorkspaceService {

if (!noAddToConfig) {
const config = this.config;
config.vaults.push(vault);
config.vaults.unshift(vault);
await this.setConfig(config);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-core/src/commands/VaultAddCommand.ts
Expand Up @@ -145,7 +145,7 @@ export class VaultAddCommand extends BasicCommand<CommandOpts, CommandOutput> {
if (vault.name) {
vault2Folder.name = vault.name;
}
const folders = out.folders.concat(vault2Folder);
const folders = [vault2Folder].concat(out.folders);
out = assignJSONWithComment({ folders }, out);
writeJSONWithComments(wsPath, out);
}
Expand Down
Expand Up @@ -114,7 +114,6 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: newVault.fsPath,
name: "dendron",
Expand All @@ -123,6 +122,7 @@ suite("VaultAddCommand", function () {
url: remote,
},
},
vault,
],
});
expect(fs.existsSync(path.join(wsRoot, ".gitignore"))).toBeFalsy();
Expand Down Expand Up @@ -152,7 +152,6 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: newVault.fsPath,
name: "dendron",
Expand All @@ -161,6 +160,7 @@ suite("VaultAddCommand", function () {
url: remote,
},
},
vault,
],
});
expect(fs.existsSync(gitIgnore)).toBeTruthy();
Expand Down Expand Up @@ -202,10 +202,10 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: "vault2",
},
vault,
],
});

Expand All @@ -231,10 +231,10 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: "vault2",
},
vault,
],
});
done();
Expand All @@ -257,10 +257,10 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: "vault2",
},
vault,
],
});
done();
Expand All @@ -284,10 +284,10 @@ suite("VaultAddCommand", function () {
checkVaults({
wsRoot,
vaults: [
vault,
{
fsPath: vaultRelPath,
},
vault,
],
});

Expand Down

0 comments on commit 37adc5e

Please sign in to comment.