diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-14 16:14:40 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-18 08:18:50 +0000 |
commit | 7efc56e59dfd7cc300f92e3c3e7744202fd7b021 (patch) | |
tree | c942f4997d68bb8be13c3a62b07bc6cc62f88518 | |
parent | af6d5225bcaea934ae15642b9fa45aecfcaf0d31 (diff) | |
download | qtrepotools-7efc56e59dfd7cc300f92e3c3e7744202fd7b021.tar.gz |
qt5_tool: Adapt to commercial repository
- Read the git config files from the submodules
- Do not error out if the requested branch does not exist yet
Change-Id: I850c948e533a3f41853cd03cd721c158f088ad0c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rwxr-xr-x | bin/qt5_tool | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/qt5_tool b/bin/qt5_tool index ab492aa..0a8de0d 100755 --- a/bin/qt5_tool +++ b/bin/qt5_tool @@ -416,6 +416,8 @@ sub readGitConfig { my ($module, $key) = @_; my $gitConfigFile = File::Spec->catfile($rootDir, $module, '.git', 'config'); + # Check submodules + $gitConfigFile = File::Spec->catfile($rootDir, '.git', 'modules', $module, 'config') unless -f $gitConfigFile; my $hashRef = readConfigFile($gitConfigFile); my $value = $$hashRef{$key}; return defined($value) ? $value : ''; @@ -606,7 +608,10 @@ sub checkoutBranch return 0; } $rc = execute($git, ('branch', '--track', $desiredBranch, $remoteBranchName)); - die 'Creation of ' . $desiredBranch . ' tracking ', $remoteBranchName, ' failed' if ($rc); + if ($rc) { + warn('Creation of ' . $desiredBranch . ' tracking ', $remoteBranchName, ' failed'); + return 0; + } } print 'switching ',$mod, ' from "', $currentBranch,'" to "',$desiredBranch,"\".\n"; $rc = execute($git, ('checkout', $desiredBranch)); |