mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-03 15:06:25 +08:00
Add 'staging' remote to repos which don't have a staging area
This makes it simpler to do
git submodule foreach
commands, since you don't need to worry about the repos without
any staging area.
This commit is contained in:
@@ -428,18 +428,30 @@ sub git_add_staging_remote
|
||||
|
||||
my @staging = grep { /^$repo_basename$/; } keys %STAGING_REPOS;
|
||||
|
||||
foreach my $staging_repo (@staging) {
|
||||
# nothing to do if remote already exists
|
||||
next if ($current_remotes{$staging_repo});
|
||||
|
||||
my $staging_repo_url = $STAGING_REPOS{$staging_repo};
|
||||
if ($protocol) {
|
||||
if ($protocol ne 'http') {
|
||||
$staging_repo_url =~ s,^git://gitorious\.org/qt-labs/,${url_base_for_protocol}qt/,;
|
||||
if (!@staging) {
|
||||
# Add origin's URL as staging's URL, since this repo has no separate staging area
|
||||
unless ($current_remotes{'staging'}) {
|
||||
my @configresult = qx(git remote -v);
|
||||
foreach (@configresult) {
|
||||
if (/origin\s+(\S+) \(fetch\)/) {
|
||||
$self->exe('git', 'remote', 'add', 'staging', $1);
|
||||
}
|
||||
}
|
||||
$staging_repo_url =~ s,^git://gitorious\.org/,$url_base_for_protocol,;
|
||||
}
|
||||
$self->exe('git', 'remote', 'add', 'staging', $staging_repo_url);
|
||||
} else {
|
||||
foreach my $staging_repo (@staging) {
|
||||
# nothing to do if remote already exists
|
||||
next if ($current_remotes{'staging'});
|
||||
|
||||
my $staging_repo_url = $STAGING_REPOS{$staging_repo};
|
||||
if ($protocol) {
|
||||
if ($protocol ne 'http') {
|
||||
$staging_repo_url =~ s,^git://gitorious\.org/qt-labs/,${url_base_for_protocol}qt/,;
|
||||
}
|
||||
$staging_repo_url =~ s,^git://gitorious\.org/,$url_base_for_protocol,;
|
||||
}
|
||||
$self->exe('git', 'remote', 'add', 'staging', $staging_repo_url);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user