From: Junio C Hamano Date: Mon, 28 Nov 2005 09:24:10 GMT Subject: Re: [PATCH] git-mv: fully detect 'directory moved into itself' Message-ID: <7vbr05xgzp.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <200511281015.15188.Josef.Weidendorfer@gmx.de> Josef Weidendorfer writes: > This is a corrected version. > > On Monday 28 November 2005 07:54, Matthias Urlichs wrote: >> Hi, Josef Weidendorfer wrote: >> >> > + if (($bad eq "") && ($dst =~ /^$src\//)) { >> >> That should be >> >> > + if (($bad eq "") && ($dst =~ /^\Q$src\E\//)) { >> >> otherwise you will mistakenly match "foo-bar" with "foo.bar". > > Ah, thanks. > You never end learning. Why not use $safesrc you already have for this exact purpose?