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

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

From
SGsimon gao <simon29rock@gmail.com>
Date
Jul 25, 2019, 10:43 UTC
Message-ID
<1564051425-69139-1-git-send-email-simon29rock@gmail.com>
Signed-off-by: simon gao <simon29rock@gmail.com>
---
 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
Next: simon gao
Message 1 of 2 in “stop it from failing silently when git apply patch and show err info”
  1. stop it from failing silently when git apply patch and show err infosimon gao, Jul 25, 2019
  2. simon gaoJul 25, 2019

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.