Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Re: [PATCH 1/2] git-submodule: move cloning into a separate function

From: Lars Hjemli <hidden>
Date: 2016-06-15 22:43:17

On 6/17/07, Sven Verdoolaege [off-list ref] wrote:
On Tue, Jun 05, 2007 at 01:13:28PM +0200, Lars Hjemli wrote:
quoted
+module_clone()
+{
+     path=$1
+     url=$2
+
+     # If there already is a directory at the submodule path,
+     # expect it to be empty (since that is the default checkout
+     # action) and try to remove it.
+     # Note: if $path is a symlink to a directory the test will
+     # succeed but the rmdir will fail. We might want to fix this.
+     if test -d "$path"
+     then
+             rmdir "$path" 2>/dev/null ||
+             die "Directory '$path' exist, but is neither empty nor a git repository"
What makes you say that '$path' is not a git repository?
The function assumes it's only invoked when no repo is present in $path/.git.

-- 
larsh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help