mirror of
git://code.qt.io/qt/qt5.git
synced 2025-12-21 07:28:21 +08:00
always check out the target branch when using --branch
a submodule update with --remote will use the tip of the remote's branch, but it won't actually switch to the branch if HEAD doesn't point to it yet. Change-Id: If13e31da2646683dfb9e832eaab929190acb0167 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
This commit is contained in:
committed by
Simon Hausmann
parent
b236ef6aef
commit
d553fc4fa9
@@ -386,20 +386,7 @@ sub git_clone_all_submodules
|
||||
$self->git_clone_one_submodule($subdirs{$module}, $subbases{$module});
|
||||
}
|
||||
|
||||
if ($self->{update}) {
|
||||
my @cmd = ('git', 'submodule', 'update');
|
||||
push @cmd, '--remote', '--rebase' if ($co_branch);
|
||||
$self->exe(@cmd);
|
||||
|
||||
foreach my $module (@modules) {
|
||||
if (-f $module.'/.gitmodules') {
|
||||
my $orig_cwd = getcwd();
|
||||
chdir($module) or confess "chdir $module: $OS_ERROR";
|
||||
$self->git_clone_all_submodules($subbases{$module}, 0, "all");
|
||||
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
|
||||
}
|
||||
}
|
||||
} elsif ($co_branch) {
|
||||
if ($co_branch) {
|
||||
foreach my $module (@modules) {
|
||||
my $branch = $subbranches{$module};
|
||||
die("No branch defined for submodule $module.\n") if (!defined($branch));
|
||||
@@ -414,6 +401,20 @@ sub git_clone_all_submodules
|
||||
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
|
||||
}
|
||||
}
|
||||
if ($self->{update}) {
|
||||
my @cmd = ('git', 'submodule', 'update');
|
||||
push @cmd, '--remote', '--rebase' if ($co_branch);
|
||||
$self->exe(@cmd);
|
||||
|
||||
foreach my $module (@modules) {
|
||||
if (-f $module.'/.gitmodules') {
|
||||
my $orig_cwd = getcwd();
|
||||
chdir($module) or confess "chdir $module: $OS_ERROR";
|
||||
$self->git_clone_all_submodules($subbases{$module}, 0, "all");
|
||||
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user