Исправил ошибку git при открытии файла или каталога если репозиторий не инициализирован (нет .git каталога внутри проекта)

This commit is contained in:
svkalinin
2022-11-28 15:29:40 +03:00
parent 37ab3e4a6b
commit b10b1802a5
3 changed files with 14 additions and 4 deletions

View File

@@ -92,8 +92,11 @@ namespace eval Git {
global cfgVariables activeProject
set cmd exec
set d [pwd]
if {$activeProject ne ""} {
if {$activeProject ne "" && [file isdirectory $activeProject] == 1} {
cd $activeProject
if ![file exists .git] {
return
}
} else {
return ""
}
@@ -127,7 +130,14 @@ namespace eval Git {
proc Status {} {
global cfgVariables activeProject
cd $activeProject
if [file isdirectory $activeProject] {
cd $activeProject
if ![file exists .git] {
return
}
} else {
return false
}
set cmd exec
lappend cmd $cfgVariables(gitCommand)
lappend cmd "status"