git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin-apply.c: do not set bogus mode in check_preimage() for deleted path

From
DZDon Zickus <dzickus@redhat.com>
Date
Jan 29, 2009, 01:46 UTC
Message-ID
<20090129014620.GE13271@redhat.com>
In-Reply-To
<7vocxrj9j9.fsf@gitster.siamese.dyndns.org>
On Wed, Jan 28, 2009 at 03:27:54PM -0800, Junio C Hamano wrote:
>    Also I suspect this codepath has been broken the use case 7a07841
>    (git-apply: handle a patch that touches the same path more than once
>    better, 2008-06-27) wanted to support, and if that is the case, this
>    would fix it.

Actually deleting patches weren't that interesting to me, I deal more with patches modifying the same patch repeatedly. Regardless the patch below seems ok to me.

Acked-by: Don Zickus <dzickus@redhat.com>
Show 20 quoted lines
> 
>  builtin-apply.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin-apply.c b/builtin-apply.c
> index b415daf..1e7f917 100644
> --- a/builtin-apply.c
> +++ b/builtin-apply.c
> @@ -2453,7 +2453,7 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s
>  	if (st_mode != patch->old_mode)
>  		fprintf(stderr, "warning: %s has type %o, expected %o\n",
>  			old_name, st_mode, patch->old_mode);
> -	if (!patch->new_mode)
> +	if (!patch->new_mode && !patch->is_delete)
>  		patch->new_mode = st_mode;
>  	return 0;
>  
> -- 
> 1.6.1.1.278.g6a817
> 
Previous: Junio C Hamano
Message 2 of 2 in “builtin-apply.c: do not set bogus mode in check_preimage() for deleted path”
  1. builtin-apply.c: do not set bogus mode in check_preimage() for deleted pathJunio C Hamano, Jan 28, 2009
  2. Don ZickusJan 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.