From: Mark Levedahl Date: Fri, 9 Feb 2024 22:58:04 +0000 (-0500) Subject: git-gui: use git_init to create new repository dir X-Git-Tag: v2.51.0-rc0~46^2^2~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c85557098f90801583866d9829719b6e2cf4cd49;p=thirdparty%2Fgit.git git-gui: use git_init to create new repository dir When creating a new repository, git-gui creates a directory, cds to it, then runs git-init, but git-init learned to create and initialize the directory in 1.6.5. git-gui requires git version >= 2.36, so teach git-gui to use git-init's full capability. Signed-off-by: Mark Levedahl --- diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl index 5b361cc424..1711f7ca55 100644 --- a/lib/choose_repository.tcl +++ b/lib/choose_repository.tcl @@ -323,7 +323,7 @@ method _write_local_path {args} { } method _git_init {} { - if {[catch {file mkdir $local_path} err]} { + if {[catch {git init $local_path} err]} { error_popup [strcat \ [mc "Failed to create repository %s:" $local_path] \ "\n\n$err"] @@ -337,13 +337,6 @@ method _git_init {} { return 0 } - if {[catch {git init} err]} { - error_popup [strcat \ - [mc "Failed to create repository %s:" $local_path] \ - "\n\n$err"] - return 0 - } - _append_recentrepos [pwd] set ::_gitdir .git set ::_prefix {}