Commit e3c41daf authored by Michael Pyne's avatar Michael Pyne
Browse files

Use 'tag' option when cloning git modules.

This partially implements bug 308493. To fully implement it will be
required to handle the case of an already-checked-out module (though
prepatory work is already complete).

CCBUG:308493
parent f96d0f92
......@@ -2252,6 +2252,9 @@ anonymous repository.</para></note>
want</emphasis> to use this option. &kde; releases are available in tarball form
from <ulink url="ftp://ftp.kde.org/">The &kde; FTP site</ulink> or one of <ulink
url="http://download.kde.org/download.php">its mirrors</ulink>.</para>
<note><para>This option has only been supported for git-based modules since
&kdesrc-build; 1.16.</para></note>
</entry>
</row>
......
......@@ -2549,11 +2549,16 @@ EOM
$module->setPersistentOption('git-cloned-repository', $git_repo);
my $branch = $self->getBranch();
p_chdir($srcdir);
# Switch immediately to user-requested branch now.
if ($branch ne 'master') {
# Switch immediately to user-requested tag or branch now.
if (my $tag = $module->getOption('tag')) {
info ("\tSwitching to specific tagged-commit g[$tag]");
$result = (log_command($module, 'git-checkout-tag',
['git', 'checkout', "refs/tags/$tag"]) == 0);
}
elsif ((my $branch = $self->getBranch()) ne 'master') {
info ("\tSwitching to branch g[$branch]");
p_chdir($srcdir);
$result = (log_command($module, 'git-checkout',
['git', 'checkout', '-b', $branch, "origin/$branch"]) == 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment