From 46fce4935610b99b399753f50d829d3f5c84b662 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 20 Jun 2019 14:10:42 +0200 Subject: [PATCH] fix(core): update --- test/test.ts | 8 ++++++++ ts/smartgit.classes.gitrepo.ts | 6 +++--- ts/smartgit.plugins.ts | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/test.ts b/test/test.ts index 84f6365..faba970 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,4 +1,12 @@ import { tap, expect } from '@pushrocks/tapbundle'; import * as smartgit from '../ts/index'; +import * as path from 'path'; + +const testRepoDir = path.join(__dirname, '../.nogit/testrepo'); + +tap.test('should create a new repo at .nogit', async () => { + const gitRepo = await smartgit.GitRepo.fromCreatingRepoInDir(testRepoDir); +}) + tap.start(); diff --git a/ts/smartgit.classes.gitrepo.ts b/ts/smartgit.classes.gitrepo.ts index 974bf2d..ed39172 100644 --- a/ts/smartgit.classes.gitrepo.ts +++ b/ts/smartgit.classes.gitrepo.ts @@ -8,7 +8,7 @@ export class GitRepo { /** * creates a new GitRepo Instance after cloning a project */ - public static async createRepoFromClone(fromArg: string, toArg: string): Promise { + public static async fromCloningIntoDir(fromArg: string, toArg: string): Promise { const dirArg = plugins.path.resolve(toArg); const ngRespository = await plugins.nodegit.Clone.clone(fromArg, toArg, { bare: 0, @@ -17,13 +17,13 @@ export class GitRepo { return new GitRepo(ngRespository); } - public static async createNewRepoInDir(dirArg: string): Promise { + public static async fromCreatingRepoInDir(dirArg: string): Promise { dirArg = plugins.path.resolve(dirArg); const ngRepository = await plugins.nodegit.Repository.init(dirArg, 0); return new GitRepo(ngRepository); } - public static async openRepoAt(dirArg: string) { + public static async fromOpeningRepoDir(dirArg: string) { dirArg = plugins.path.resolve(dirArg); const ngRepository = await plugins.nodegit.Repository.open(dirArg); return new GitRepo(ngRepository); diff --git a/ts/smartgit.plugins.ts b/ts/smartgit.plugins.ts index efe6178..a481835 100644 --- a/ts/smartgit.plugins.ts +++ b/ts/smartgit.plugins.ts @@ -11,6 +11,6 @@ import * as smartstring from '@pushrocks/smartstring'; export { smartfile, smartpath, smartpromise, smartstring }; // third party -import * as nodegit from 'nodegit'; +import nodegit from 'nodegit'; export { nodegit };