git clone (ssh://) skips detached HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For some reason git doesn't try to fetch detached HEAD object if it's
not needed by needed heads.
It could be just work on top of detached HEAD or checked out remote branch.

Steps to reproduce:
git init test && cd test
touch 1 && git add 1 && git commit -m 123
touch 2 && git add 2 && git commit -m 345
git reset --hard HEAD^
git checkout HEAD@{1}

cd ../
git clone ssh://127.0.0.1/`pwd`/test test2

remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
error: Trying to write ref HEAD with nonexistant object
91dbc2403853783f637744c31036f94a66084286
fatal: Cannot update the ref 'HEAD'.

HEAD seems to be treated in a special way in various places, so
haven't found any easy patch to fix this.

And by the way, clone --no-hardlinks test test2 still goes to is_local
codepath and avoids the bug.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]