aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-06-05 16:01:44 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:32 +0200
commit47b51bdcb78ac1e82e9cda60aafa0f5fe4d8e290 (patch)
tree6f65506587c5497de3241d7eeb5772e50df1896b
parent10596d7eb5edb6dbeeedccfd1fa2df81141adda4 (diff)
Only init git if it doesn't exist
-rw-r--r--src/main.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}