* [PATCH] builtin-apply.c: do not set bogus mode in check_preimage() for deleted path
@ 2009-01-28 23:27 Junio C Hamano
2009-01-29 1:46 ` Don Zickus
0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2009-01-28 23:27 UTC (permalink / raw)
To: git; +Cc: Don Zickus, Alexander Potashev
If it is deleted, it is deleted. Do not set the current mode to it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* This updates 1f7903a (builtin-apply: prevent non-explicit permission
changes, 2009-01-02). It should not change the behaviour in the normal
case, because we do not explicitly check the final mode of a deletion
patch. We do check the deletion patch creates an empty result, and we
might want to fix that someday, and at that point the existing code
will break.
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.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] builtin-apply.c: do not set bogus mode in check_preimage() for deleted path
2009-01-28 23:27 [PATCH] builtin-apply.c: do not set bogus mode in check_preimage() for deleted path Junio C Hamano
@ 2009-01-29 1:46 ` Don Zickus
0 siblings, 0 replies; 2+ messages in thread
From: Don Zickus @ 2009-01-29 1:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Alexander Potashev
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>
>
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-29 1:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 23:27 [PATCH] builtin-apply.c: do not set bogus mode in check_preimage() for deleted path Junio C Hamano
2009-01-29 1:46 ` Don Zickus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).