[PATCH] submodule: fix quoting in relative_path()

2013-04-24 Thread John Keeping
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

Re: [PATCH] submodule: fix quoting in relative_path()

2013-04-24 Thread Junio C Hamano
John Keeping j...@keeping.me.uk 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. git-submodule.sh | 2 +- 1 file changed, 1

Re: [PATCH] submodule: fix quoting in relative_path()

2013-04-24 Thread John Keeping
On Wed, Apr 24, 2013 at 09:21:38AM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk 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

Re: [PATCH] submodule: fix quoting in relative_path()

2013-04-24 Thread Johannes Sixt
Am 24.04.2013 18:28, schrieb John Keeping: On Wed, Apr 24, 2013 at 09:21:38AM -0700, Junio C Hamano wrote: J6t meant a patch to remove the entire case...esac and replace it with a single liner (target=${target#$curdir/}). Ah, I missed the six-liner part. But that doesn't work because we