Thread (13 messages) 13 messages, 2 authors, 2017-06-30
STALE3379d

[PATCH 3/4] Git::unquote_path() throw an exception on bad path

From: Phillip Wood <hidden>
Date: 2017-06-30 09:49:54
Subsystem: the rest · Maintainer: Linus Torvalds

From: Phillip Wood <redacted>

This is what the other routines in Git.pm do if there's an error.

Signed-off-by: Phillip Wood <redacted>
---
 perl/Git.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index f075b500c510d183074c0358fb24fefc72248125..baf80d1ab038590c85bc5971483517cba606881f 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1493,8 +1493,8 @@ when not using -z or when parsing the output of diff -u.
 					$_ = $2;
 					last;
 				}
-				# This is malformed -- just return it as-is for now.
-				return $_[0];
+				# This is malformed
+				throw Error::Simple("invalid quoted path $_[0]");
 			}
 			$_ = $remainder;
 		}
-- 
2.13.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help