Commit caca2c1 (submodule: drop the top-level requirement) introduced a
relative_path helper but does not quote $curdir when it is stripped from
the front of a target path.  In this particular case this should be safe
even with special characters because we only do this after checking that
$target begins with "$curdir/" which is quoted correctly, but we should
quote the variable to be certain that there is not some obscure case
where we this could strip more or less than we want.

Signed-off-by: John Keeping <>
On Fri, Apr 19, 2013 at 02:03:14PM -0700, Junio C Hamano wrote:
> Johannes Sixt <> writes:
> > Why not just replace the six-liner by this one-liner:
> >
> >             target=${target#"$curdir"/}
> Simple enough ;-)

This seems to have arrived on next without this fix, so here's a patch
on top. | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ b/
index 0eee703..db9f260 100755
--- a/
+++ b/
@@ -127,7 +127,7 @@ relative_path ()
                case "$target" in
-                       target=${target#$curdir/}
+                       target=${target#"$curdir"/}

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to