init-repository: Support cases where $submodule/.git is a file

Since git 1.7.8 the $GIT_DIR of the submodule can be a reference to the
super-module's $GIT_DIR/modules/<name>/

Test for existence instead of testing for a directory before attempting
a git clone there.

Change-Id: Ic539e770067da1417a2ad374c21253212473abe6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Jocelyn Turcotte
2014-08-15 17:37:02 +02:00
parent 5fdb4490cb
commit 1ae0689829

View File

@@ -559,7 +559,7 @@ sub git_clone_one_submodule
}
}
my $do_clone = (! -d "$submodule/.git");
my $do_clone = (! -e "$submodule/.git");
if ($do_clone) {
$self->exe('git', 'clone', @reference_args, ($mirror ? $mirror : $url), $submodule);
}