GetComponens --update fails if a git repository is on a detached head

Create issue
Issue #2505 new
Roland Haas created an issue

if one is one a detached head eg after a git checkout master~1 then a GetComponents --update of the Cactus tree containing this repository fails with an error message along the lines:

./GetComponents --update --root . repos/cactusamrex/azure-pipelines/
  Checking out module: CarpetX/SHTOOLS
      from repository:
                 into: ./arrangements
Switched to branch 'master'
sh: 1: Syntax error: "(" unexpected (expecting "then")

?[1m?[31mWarning: ?[0mCould not update cactusamrex. Could not checkout original branch.

which is due to a set of commands in GetComponents like this:

"if [ xrefs/heads/$current_branch != x`$git symbolic-ref -q HEAD` ] ; then " .
"  $git checkout $current_branch ; " .

which fail if $current_branch reads (HEAD detached at 6b009bf).

Comments (0)

  1. Log in to comment