git gc seems to break --symbolic-full-name
- From
- Stas Sergeev <stsp@list.ru>
- Date
- Jul 21, 2017, 17:40 UTC
- Message-ID
- <234492d7-7fd6-f847-8b85-010732ff43b6@list.ru>
Hello.
I do the following:
$ git rev-parse --symbolic-full-name devel refs/heads/devel $ ls -l .git/`git rev-parse --symbolic-full-name devel` -rw-rw-r-- 1 stas stas 41 июл 21 15:05 .git/refs/heads/devel
This is fine. But after git gc:
$ git rev-parse --symbolic-full-name devel refs/heads/devel $ LC_ALL=C ls -l .git/`git rev-parse --symbolic-full-name devel` ls: cannot access '.git/refs/heads/devel': No such file or directory
This is because after git gc there is nothing in .git/refs/heads:
$ LC_ALL=C ls -l .git/refs/heads/ total 8 drwxrwxr-x 2 stas stas 4096 Jul 31 2013 feature drwxrwxr-x 2 stas stas 4096 Dec 23 2016 pr
I prepend the path with .git above just as an example: the same happens with rev-parse --git-path.
So I wonder if it is an expected behaviour for --symbolic-full-name to return the invalid pathes? If so, how can I get the path to the needed head file? I use that for dependency tracking.