diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2012-03-08 14:28:52 -0600 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-09 21:14:07 +0100 |
commit | aa431f407f9d971d93d6b117989af576dc3728b2 (patch) | |
tree | e0818af0bc49c3007b42b934ff4780fffd6a03cc | |
parent | 944f23b42b16ec81dc01a8d5b6d958153c277edb (diff) |
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>
-rwxr-xr-x | init-repository | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/init-repository b/init-repository index 4c4d7b03..489680c2 100755 --- a/init-repository +++ b/init-repository @@ -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"; |