@leroysheep / LeeRoySheep / commits / c85557098f

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 <mlevedahl@gmail.com>

Mark Levedahl committed Feb 9, 2024 at 17:58 UTC c85557098f90801583866d9829719b6e2cf4cd49
1 file changed +1 -8
lib/choose_repository.tcl
+1 -8
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 {}