mirror of
git://code.qt.io/qt/qt5.git
synced 2026-03-20 13:32:42 +08:00
don't fail to check out some modules in pinned mode
when used without the --branch option, we clone with --no-checkout, to avoid unnecessarily checking out files twice when the recorded sha1 doesn't happen to be the tip of the default branch. however, that would leave the index in a dirty state which would make the subsequent submodule update abort at some point, silently. to deal with the problem, we ignore this type of index dirtyness and use submodule update with --force. Task-number: QTBUG-57289 Change-Id: I6fc9693b0eaadfb04d2d80f9c8f1f2e11be47ae9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
@@ -424,7 +424,7 @@ sub git_clone_all_submodules
|
||||
}
|
||||
}
|
||||
if ($self->{update}) {
|
||||
my @cmd = ('git', 'submodule', 'update', '--no-fetch');
|
||||
my @cmd = ('git', 'submodule', 'update', '--force', '--no-fetch');
|
||||
push @cmd, '--remote', '--rebase' if ($co_branch);
|
||||
$self->exe(@cmd);
|
||||
|
||||
@@ -471,6 +471,13 @@ sub git_stat_one_submodule
|
||||
|
||||
my @sts = qx(git status --porcelain --untracked=no);
|
||||
|
||||
# After a git clone --no-checkout, git status reports all files as
|
||||
# staged for deletion, but we still want to update the submodule.
|
||||
# It's unlikely that a genuinely dirty index would have _only_ this
|
||||
# type of modifications, and it doesn't seem like a horribly big deal
|
||||
# to lose them anyway, so ignore them.
|
||||
@sts = grep(!/^D /, @sts);
|
||||
|
||||
chdir($orig_cwd) or confess "cd $orig_cwd: $OS_ERROR";
|
||||
|
||||
return 0 if (!@sts);
|
||||
|
||||
Reference in New Issue
Block a user