[PATCH 5/5] git-gui: mkdir -p when initializing new remote repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows the user to create repositories with arbitrary paths
on the server. The downside is that errorneously typed paths are
not caught but instead created remotely; YMMV.

This patch has been sponsored by Novartis.

Signed-off-by: Petr Baudis <pasky@xxxxxxx>

---
 git-gui/lib/remote_add.tcl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-gui/lib/remote_add.tcl b/git-gui/lib/remote_add.tcl
index 89e88ee..8e3ad16 100644
--- a/git-gui/lib/remote_add.tcl
+++ b/git-gui/lib/remote_add.tcl
@@ -144,8 +144,9 @@ method _add {} {
 			if {[info exists env(GIT_SSH)]} {
 				set ssh $env(GIT_SSH)
 			}
-			lappend cmds [list exec $ssh $host git --git-dir=$path init --bare]
+			lappend cmds [list exec $ssh $host mkdir -p $location && git --git-dir=$path init --bare]
 		} elseif { ! [regexp {://} $location xx] } {
+			lappend cmds [list exec mkdir -p $location]
 			lappend cmds [list exec git --git-dir=$location init --bare]
 		} else {
 			tk_messageBox \
-- 
tg: (f30d624..) t/git-gui/remote-mkdir (depends on: t/git-gui/remote-add)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux