Skip to content

Commit

Permalink
git-mv: fully detect 'directory moved into itself'
Browse files Browse the repository at this point in the history
This gives a better error message when trying to move a directory
into some subdirectory of itself; ie. no real bug fix: renaming
already failed before, but with a strange "invalid argument".

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Josef Weidendorfer authored and Junio C Hamano committed Nov 27, 2005
1 parent f6bc189 commit ca203ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-mv.perl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ()
}
}

if (($bad eq "") && ($src eq $dstDir)) {
if (($bad eq "") && ($dst =~ /^$src\//)) {
$bad = "can not move directory '$src' into itself";
}

Expand Down

0 comments on commit ca203ee

Please sign in to comment.