Subject: Re: is ORIG_HEAD allowed to point to a non-existing object?

From: Junio C Hamano <[email-masked]>
Date: Tue, 10 May 2016 11:14:06 -0700

Christian Halstrick <[email-masked]> writes:

> If I do a "git-rebase -i ..." followed by "git reflog expire ..." and
> "git gc ..." then I can end up with a repo which has a ref ORIG_HEAD
> which points to a non-existing object.
>
> - Is this intended?

Yes.

HEAD is a ref, but other things like MERGE_HEAD, ORIG_HEAD,
FETCH_HEAD are not considered as refs and they are intended to be
temporary.  This does mean that they will become invalid if you
prune objects that are only reachable from them, but your "reflog
expire && gc" falls into "if it hurts, don't do it".