Linus Torvalds wrote:
On Tue, 21 Jun 2005, Jeff Garzik wrote:
If git-checkout-script switches the .git/HEAD symlink properly, rather than updating the symlink target's contents, then my git-switch-tree script can just go away :)
Well, you should test it. I sure didn't ;)
hmmm, I tried
git checkout -f ncq
on libata-dev.git and it didn't seem to switch the symlink.
[jgarzik@pretzel libata-dev]$ sh -x /usr/local/bin/git-checkout-script -f ncq
+ : .git
++ git-rev-parse HEAD
+ old=7df551254add79a445d2e47e8f849cef8fee6e38
+ new=
+ force=
+ branch=
+ '[' 2 '!=' 0 ']'
+ arg=-f
+ shift
+ case "$arg" in
+ force=1
+ i=1
+ '[' 1 '!=' 0 ']'
+ arg=ncq
+ shift
+ case "$arg" in
++ git-rev-parse ncq
+ rev=d032ec9048ff82a704b96b93cfd6f2e8e3a06b19
+ '[' -z d032ec9048ff82a704b96b93cfd6f2e8e3a06b19 ']'
+ '[' '' ']'
+ new=d032ec9048ff82a704b96b93cfd6f2e8e3a06b19
+ '[' -f .git/revs/heads/ncq ']'
+ i=2
+ '[' 0 '!=' 0 ']'
+ '[' -z d032ec9048ff82a704b96b93cfd6f2e8e3a06b19 ']'
+ '[' 1 ']'
+ git-read-tree --reset d032ec9048ff82a704b96b93cfd6f2e8e3a06b19
+ git-checkout-cache -q -f -u -a
+ '[' 0 -eq 0 ']'
+ '[' '' ']'
+ rm -f .git/MERGE_HEAD