Reputation: 398
I have the following patch
diff --git a/.htaccess b/.htaccess
index 4298b10..aa3d50d 100644
--- a/.htaccess
+++ b/.htaccess
@@ -364,6 +364,15 @@
Require all denied
</IfVersion>
</Files>
+ <Files patches>
+ <IfVersion < 2.4>
+ order allow,deny
+ deny from all
+ </IfVersion>
+ <IfVersion >= 2.4>
+ Require all denied
+ </IfVersion>
+ </Files>
# For 404s and 403s that aren't handled by the application, show plain 404 response
ErrorDocument 404 /pub/errors/404.php
When I use git apply a 2nd time the patch does not fail to apply, instead it just appends it at the same line. Is there any way to prevent this from happening?
Also when I use git apply -R it will remove one of the added instances.
Upvotes: 1
Views: 513
Reputation: 489083
The short answer is no: git apply
treats the incoming change as a patch, and merely needs to find the correct context. As long as the context continues to match—and it does in this case—the patch continues to apply.
This is one reason, perhaps the main one, to avoid using patches. A git cherry-pick
has more information available to it and will not re-apply the change.
Upvotes: 2