only checkout the target branch when topgit is used

[?]
Jul 31, 2014, 7:42 PM
2XGB45G73ZA4FQ6EEKDOWJ5MKMDRPV6LH3WWSOJZ5CEAYW5NZJSQC

Dependencies

  • [2] 6LRC7SIE forcing branch switch
  • [3] 6STC76Q6 added clean command
  • [4] JAH3UPWA Support revision control systems via plugins
  • [5] 3BTJRSU3 GitInput.pm: Don't do a chdir to the Git clone

Change contents

  • replacement in src/lib/Hydra/Plugin/GitInput.pm at line 42
    [4.7119][4.7119:7173](),[4.7173][2.0:89](),[2.89][4.1611:1711](),[4.1611][4.1611:1711](),[4.1711][3.0:292]()
    # Checkout the branch to look at its content.
    $res = run(cmd => ["git", "checkout", "--force", "$branch"], dir => $clonePath);
    die "error checking out Git branch '$branch' at `$uri':\n$res->{stderr}" if $res->{status};
    # Clean to remove potentially present artifacts after forcing branch switch
    $res = run(cmd => ["git", "clean", "-d", "-x", "--force", "--force"], dir => $clonePath);
    print STDERR "warning: `git clean -d -x --force --force' failed::\n$res->{stderr}" if $res->{status};
    [4.7119]
    [4.7347]
    # Is the target branch a topgit branch?
    $res = run(cmd => ["git", "ls-tree", "-r", "$branch", ".topgit"], dir => $clonePath);
  • replacement in src/lib/Hydra/Plugin/GitInput.pm at line 45
    [4.7348][4.7348:7377]()
    if (-f ".topdeps") {
    [4.7348]
    [4.7377]
    if ($res->{stdout} != "") {
    # Checkout the branch to look at its content.
    $res = run(cmd => ["git", "checkout", "--force", "$branch"], dir => $clonePath);
    die "error checking out Git branch '$branch' at `$uri':\n$res->{stderr}" if $res->{status};