Добавлена проверка на инициализацию репозитория

This commit is contained in:
Alexander Zhirov 2025-05-26 02:41:55 +03:00
parent 38b37eea70
commit a7676d5886
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -45,6 +45,12 @@ class Snag {
}
void initialize() {
auto result = execute(_baseCommand ~ ["rev-parse", "--git-dir"]);
!result.status &&
throw new SnagException(
"The Git repository has already been initialized: "
~ result.output.strip('\n')
);
git(
["init"],
"A Git repository initialization error occurred"