[PATCH] apply: do not allow reversing a 'copy' patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

>         Action item: warn users against using "apply -R" on a
>         patchset with such a patch while this is fixed.

This needs to be replaced with the logic to properly reverse a patch
that creates a new file by copying from somewhere else, but for now,
this would be a good idea to prevent lossages from happening.

 builtin/apply.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/builtin/apply.c b/builtin/apply.c
index 0aad912..b33b403 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -2069,6 +2069,9 @@ static void reverse_patches(struct patch *p)
 	for (; p; p = p->next) {
 		struct fragment *frag = p->fragments;
 
+		if (p->is_copy)
+			die(_("sorry, cannot apply a 'copying' patch in reverse (yet)"));
+
 		swap(p->new_name, p->old_name);
 		swap(p->new_mode, p->old_mode);
 		swap(p->is_new, p->is_delete);
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]