shithub: git9

ref: c65ded47aa82d89e1998ed0e8bbc8b1009d25642
dir: /revert/

View raw version
#!/bin/rc
rfork en
. /sys/lib/git/common.rc

gitup

flagfmt='c:query query' args='file ...'
eval `''{aux/getflags $*} || exec aux/usage

commit=$gitfs/HEAD
if(~ $#query 1)
	commit=`{git/query -p $query}

files=`$nl{cleanname -d $gitrel $*}
for(f in `$nl{cd $commit/tree/ && walk -f $files}){
	mkdir -p `{basename -d $f}
	cp -x -- $commit/tree/$f $f
	git/add $f
}
exit ''