Re: git-mv is not able to handle directory with one file in it
From: Josef Weidendorfer <hidden>
Date: 2016-06-15 22:42:13
On Wednesday 23 November 2005 08:26, Alexander Litvinov wrote:
I have found one error during directory movig: If I move directory with one file somewhere in it this script will try to add target directory instead of file. Commenting lines starting from 190 solve this error. But I don't understand what is the logic behind this case ? Why do target directory checked instead of target file ?
$src/$dst pairs match the arguments given on the command line of git-mv, And git-mv (as was git-rename) is able to move directory trees around. It is simplier to keep the granularity at directories, as multiple moves of directories can not overlap each other. If you do it at file level, you have to remote and create directories yourself. Of course, for git it is done at file level (that are the @srcfiles/@dstfiles arrays), but this is quite trivial as git does not work with directories, but only with files.
Should we replace $dst my $destfiles[0] ?
Yes, that was part of my patch. Josef