Skip to content

Commit c855570

Browse files
committed
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 <[email protected]>
1 parent 8b48034 commit c855570

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/choose_repository.tcl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ method _write_local_path {args} {
323323
}
324324

325325
method _git_init {} {
326-
if {[catch {file mkdir $local_path} err]} {
326+
if {[catch {git init $local_path} err]} {
327327
error_popup [strcat \
328328
[mc "Failed to create repository %s:" $local_path] \
329329
"\n\n$err"]
@@ -337,13 +337,6 @@ method _git_init {} {
337337
return 0
338338
}
339339

340-
if {[catch {git init} err]} {
341-
error_popup [strcat \
342-
[mc "Failed to create repository %s:" $local_path] \
343-
"\n\n$err"]
344-
return 0
345-
}
346-
347340
_append_recentrepos [pwd]
348341
set ::_gitdir .git
349342
set ::_prefix {}

0 commit comments

Comments
 (0)