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:
parent
0339e9ac44
commit
21075859e4
1 changed files with 3 additions and 2 deletions
|
@ -11,9 +11,10 @@ commit=$gitfs/HEAD
|
||||||
if(~ $#query 1)
|
if(~ $#query 1)
|
||||||
commit=`{git/query -p $query}
|
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}
|
mkdir -p `{basename -d $f}
|
||||||
cp -- $commit/tree/$f $f
|
cp -x -- $commit/tree/$f $f
|
||||||
git/add $f
|
git/add $f
|
||||||
}
|
}
|
||||||
exit ''
|
exit ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue