git/revert: handle absolute paths gracefully (thanks deuteron)

when reverting files, absolute paths would get concatenated with
$gitrel; use `cleanname -d` to fix this.
This commit is contained in:
Ori Bernstein 2021-06-21 02:12:58 +00:00
parent 0339e9ac44
commit 21075859e4

View file

@ -11,9 +11,10 @@ commit=$gitfs/HEAD
if(~ $#query 1)
commit=`{git/query -p $query}
for(f in `$nl{cd $commit/tree/ && walk -f ./$gitrel/$*}){
files=`$nl{cleanname -d $gitrel $*}
for(f in `$nl{cd $commit/tree/ && walk -f $files}){
mkdir -p `{basename -d $f}
cp -- $commit/tree/$f $f
cp -x -- $commit/tree/$f $f
git/add $f
}
exit ''