[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH 2/2] builtin-reflog: fix deletion of HEAD entries
From:       Johannes Sixt <johannes.sixt () telecom ! at>
Date:       2008-08-10 11:12:48
Message-ID: 200808101312.48213.johannes.sixt () telecom ! at
[Download RAW message or body]

On Sonntag, 10. August 2008, Pieter de Bie wrote:
> diff --git a/builtin-reflog.c b/builtin-reflog.c
> index 5af3f28..a8311a6 100644
> --- a/builtin-reflog.c
> +++ b/builtin-reflog.c
> @@ -541,14 +541,15 @@ static int cmd_reflog_expire(int argc, const char
> **argv, const char *prefix) }
>
>  	while (i < argc) {
> -		const char *ref = argv[i++];
> +		char *ref;
>  		unsigned char sha1[20];
> -		if (!resolve_ref(ref, sha1, 1, NULL)) {
> -			status |= error("%s points nowhere!", ref);
> +		if (!dwim_log(argv[i], strlen(argv[i]), sha1, &ref)) {
> +			status |= error("%s points nowhere!", argv[i]);
>  			continue;
>  		}
>  		set_reflog_expiry_param(&cb, explicit_expiry, ref);
>  		status |= expire_reflog(ref, sha1, 0, &cb);
> +		i++;
>  	}
>  	return status;
>  }

This runs into an endless loop in the error case because it doesn't increase 
i.

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic