# Bad object pointed under refs/head/

2 messages from 2015-02-13 to 2015-02-14. Participants: Zheng Zhang, Michael Haggerty.
Thread: https://gitlist.dev/t/38561

## Zheng Zhang, 2015-02-13 10:06

Subject: Bad object pointed under refs/head/
Message-ID: <CAN6kTyfiw6QPk469xV6gyL-+YB5Ca3vNHhEX7daiyn7j536SXQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAN6kTyfiw6QPk469xV6gyL-%2BYB5Ca3vNHhEX7daiyn7j536SXQ%40mail.gmail.com

```
Hi,

I was running some test with Git 1.8.4.5, then I accidentally met a
problem that leaded to the following error,

> > error: refs/heads/develop does not point to a valid object!

Turns out that the sha in refs/heads/develop is a bad object id, this
happened after merging a branch X to branch develop, but packed-refs
is updated to a corrected sha. No other merges at that point.

The fix is easy, just removed refs/heads/develop.

So there were two sha created, one is updated to refs/heads/develop,
and the other one which is corrected, updated to packed-refs,  Weird.

I am wondering if there is a way to prevent this happening? Is this an
ancient bug?

Many thanks

-- 
GitCafe.com
Share a cup of open source

Zhang Zheng
@simsicon

```

## Michael Haggerty, 2015-02-14 06:19

Subject: Re: Bad object pointed under refs/head/
Message-ID: <54DEE8DE.9060501@alum.mit.edu>
URL: https://gitlist.dev/e/54DEE8DE.9060501%40alum.mit.edu
In-Reply-To: <CAN6kTyfiw6QPk469xV6gyL-+YB5Ca3vNHhEX7daiyn7j536SXQ@mail.gmail.com>

```
On 02/13/2015 11:06 AM, Zheng Zhang wrote:
> I was running some test with Git 1.8.4.5, then I accidentally met a
> problem that leaded to the following error,
> 
>>> error: refs/heads/develop does not point to a valid object!
> 
> Turns out that the sha in refs/heads/develop is a bad object id, this
> happened after merging a branch X to branch develop, but packed-refs
> is updated to a corrected sha. No other merges at that point.
> 
> The fix is easy, just removed refs/heads/develop.
> 
> So there were two sha created, one is updated to refs/heads/develop,
> and the other one which is corrected, updated to packed-refs,  Weird.
> 
> I am wondering if there is a way to prevent this happening? Is this an
> ancient bug?

If you can find and document a way to reproduce this problem, then you
will have a much better chance of finding somebody who is willing to
look into it. Otherwise it's hard to know how to even get started.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu

```
