Re: [PATCH] receive-pack: crash when checking with non-exist HEAD

2015-07-23 Thread Junio C Hamano
Jeff King writes: > On Wed, Jul 22, 2015 at 01:30:00PM -0700, Junio C Hamano wrote: > >> For example, in order to "git commit" from such a state to create >> the root commit on that branch, existing unrelated branches whose >> names collide with the branch must be removed, which would mean one >>

Re: [PATCH] receive-pack: crash when checking with non-exist HEAD

2015-07-22 Thread Jeff King
On Wed, Jul 22, 2015 at 01:30:00PM -0700, Junio C Hamano wrote: > I see a similar "if head_name is NULL, don't bother." check in > is_ref_checked_out() so in that sense this is a correct fix to the > immediate problem. That check came from 986e8239 (receive-pack: > detect push to current branch o

Re: [PATCH] receive-pack: crash when checking with non-exist HEAD

2015-07-22 Thread Junio C Hamano
Jiang Xin writes: > If HEAD of a repository points to a conflict reference, such as: > > * There exist a reference named 'refs/heads/jx/feature1', but HEAD > points to 'refs/heads/jx', or > > * There exist a reference named 'refs/heads/feature', but HEAD points > to 'refs/heads/feature/bad'.

[PATCH] receive-pack: crash when checking with non-exist HEAD

2015-07-21 Thread Jiang Xin
If HEAD of a repository points to a conflict reference, such as: * There exist a reference named 'refs/heads/jx/feature1', but HEAD points to 'refs/heads/jx', or * There exist a reference named 'refs/heads/feature', but HEAD points to 'refs/heads/feature/bad'. When we push to delete a refere