All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, git@vger.kernel.org
Subject: Re: unable to resolve reference refs/tags/v3.1-rc8: Success (Re: git problem)
Date: Sun, 02 Oct 2011 23:15:48 -0500	[thread overview]
Message-ID: <4E8936F4.5060506@lwfinger.net> (raw)
In-Reply-To: <20111003035907.GA17134@elie>

On 10/02/2011 10:59 PM, Jonathan Nieder wrote:
> Hi,
>
> Larry Finger wrote:
>
>> I had my system freeze when doing a pull from Linus's repo. Since then,
>> every pull results in the following errors:
>>
>> ~>  git pull
>> error: unable to resolve reference refs/tags/v3.1-rc8: Success
>>  From git://github.com/torvalds/linux
>>   ! [new tag]         v3.1-rc8   ->  v3.1-rc8  (unable to update local ref)
>
> Could you try pulling again with
> "/path/to/git/sources/bin-wrappers/git pull" after applying this
> patch?
>
> Thanks,
>
> diff --git i/refs.c w/refs.c
> index a615043b..b15f78a4 100644
> --- i/refs.c
> +++ w/refs.c
> @@ -493,12 +493,15 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
>   		char *buf;
>   		int fd;
>
> -		if (--depth<  0)
> +		if (--depth<  0) {
> +			errno = ELOOP;
>   			return NULL;
> +		}
>
>   		git_snpath(path, sizeof(path), "%s", ref);
>   		/* Special case: non-existing file. */
>   		if (lstat(path,&st)<  0) {
> +			int saved_errno = errno;
>   			struct ref_list *list = get_packed_refs(NULL);
>   			while (list) {
>   				if (!strcmp(ref, list->name)) {
> @@ -509,6 +512,7 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
>   				}
>   				list = list->next;
>   			}
> +			errno = saved_errno;
>   			if (reading || errno != ENOENT)
>   				return NULL;
>   			hashclr(sha1);
> @@ -562,7 +566,8 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
>   			*flag |= REF_ISSYMREF;
>   	}
>   	if (len<  40 || get_sha1_hex(buffer, sha1))
> -		return NULL;
> +		die("ref %s is corrupt: length=%d, content=%.*s", ref,
> +		    (int) len, (int) len, buffer);
>   	return ref;
>   }

After applying that patch, I get

finger@larrylap:~/linux-2.6> ~/git/git pull
fatal: ref refs/tags/v3.1-rc8 is corrupt: length=41, content=

Larry

  reply	other threads:[~2011-10-03  4:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03  2:57 git problem Larry Finger
2011-10-03  3:59 ` unable to resolve reference refs/tags/v3.1-rc8: Success (Re: git problem) Jonathan Nieder
2011-10-03  4:15   ` Larry Finger [this message]
2011-10-03  4:40     ` unable to resolve reference refs/tags/v3.1-rc8: Success Jonathan Nieder
2011-10-03  5:11       ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E8936F4.5060506@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.