Don't try to unlink non-existing alternates file

If you clone using alternates, but the checkout you are using as
alternates does not have a submodule, there will be no alternates
file for this submodule.

Change-Id: Ibd9ed5454459587b6df9d420af4d66d61f4317ca
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Marius Storm-Olsen
2012-03-08 14:28:52 -06:00
committed by Qt by Nokia
parent 944f23b42b
commit aa431f407f

View File

@@ -590,7 +590,9 @@ sub git_clone_one_submodule
$self->exe('git', 'repack', '-a');
my $alternates_path = '.git/objects/info/alternates';
unlink($alternates_path) || confess "unlink $alternates_path: $OS_ERROR";
if (-e $alternates_path) {
unlink($alternates_path) || confess "unlink $alternates_path: $OS_ERROR";
}
}
chdir("..") or confess "cd ..: $OS_ERROR";