[PATCH] stop it from failing silently when git apply patch and show err info

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

 



Signed-off-by: simon gao <simon29rock@xxxxxxxxx>
---
 apply.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apply.c b/apply.c
index 4992eca..47b16aa 100644
--- a/apply.c
+++ b/apply.c
@@ -2093,8 +2093,10 @@ static int use_patch(struct apply_state *state, struct patch *p)
 	/* Paths outside are not touched regardless of "--include" */
 	if (state->prefix && *state->prefix) {
 		const char *rest;
-		if (!skip_prefix(pathname, state->prefix, &rest) || !*rest)
+		if (!skip_prefix(pathname, state->prefix, &rest) || !*rest){
+			error(_("%s doesn't contain the prefix(%s)"), pathname, state->prefix);
 			return 0;
+		}
 	}
 
 	/* See if it matches any of exclude/include rule */
-- 
1.8.3.1




[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]

  Powered by Linux