From 47b51bdcb78ac1e82e9cda60aafa0f5fe4d8e290 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 5 Jun 2018 16:01:44 +0200 Subject: Only init git if it doesn't exist --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index aabf83e..2ff6b3c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -642,7 +642,9 @@ int initProject(int argc, const _tinydir_char_t **argv) if(!fileOverwriteResult) fout << "Warning: Failed to create project file: " << toFileString(fileOverwriteResult.getErrMsg()) << endl; } - gitInitProject(projectPath); + auto gitProjDir = projectPath + TINYDIR_STRING("/.git"); + if(getFileType(gitProjDir.c_str()) != FileType::FILE_NOT_FOUND) + gitInitProject(projectPath); return 0; } -- cgit v1.2.3