Skip to content

is_git_dir() doesn't handle symbolic refs in HEAD (ref: refs/heads/...) #111

Closed
@ghost

Description

I have a bare repo where HEAD is a symbolic reference, I.e. it contains "ref: refs/heads/...". GitPython doesn't handle this because is_git_dir() just checks it starts with "refs" which it doesn't, so constructing a Repo object fails.

https://github.com/gitpython-developers/GitPython/blob/0.3/git/repo/fun.py#L30

it also seems to be in master:
https://github.com/gitpython-developers/GitPython/blob/master/git/util.py#L171

see also the code in git itself:
https://github.com/git/git/blob/master/path.c#L238

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions