Skip to content

nf-core list: Handle exception when HEAD is detached #297

@Zethson

Description

@Zethson
(base) [zeth@master course]$ nf-core list

                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'
Traceback (most recent call last):
  File "/home/zeth/anaconda3/bin/nf-core", line 239, in <module>
    nf_core_cli()
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/zeth/anaconda3/bin/nf-core", line 72, in list
    nf_core.list.list_workflows(sort, json, keywords)
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/nf_core/list.py", line 36, in list_workflows
    wfs.get_local_nf_workflows()
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/nf_core/list.py", line 112, in get_local_nf_workflows
    wf.get_local_nf_workflow_details()
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/nf_core/list.py", line 298, in get_local_nf_workflow_details
    self.branch = str(repo.active_branch)
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/git/repo/base.py", line 696, in active_branch
    return self.head.reference
  File "/home/zeth/anaconda3/lib/python3.7/site-packages/git/refs/symbolic.py", line 275, in _get_reference
    raise TypeError("%s is a detached symbolic reference as it points to %r" % (self, sha))
TypeError: HEAD is a detached symbolic reference as it points to '124cbbe5a070e1ee1dec25da1f65c9baea179b91'

I guess there's an issue with a git branch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions