]> git.lizzy.rs Git - plan9front.git/commitdiff
git/revert: revert
authorOri Bernstein <ori@eigenstate.org>
Tue, 29 Jun 2021 20:03:26 +0000 (20:03 +0000)
committerOri Bernstein <ori@eigenstate.org>
Tue, 29 Jun 2021 20:03:26 +0000 (20:03 +0000)
the old implementation was correct; we want to
mark it dirty and let walk sort it out.

sys/src/cmd/git/revert

index 4a7cff71bd7530966648d66ce39f69900c83f914..a516e3a9dbc36cd527085e89920b8d2afb7273fd 100644 (file)
@@ -14,9 +14,7 @@ if(~ $#query 1)
 files=`$nl{cleanname -d $gitrel $*}
 for(f in `$nl{cd $commit/tree/ && walk -f $files}){
        mkdir -p `{basename -d $f}
-       if(cp -x -- $commit/tree/$f $f)
-               walk -eq $f > .git/index9/tracked/$f
-       if not
-               echo -n > .git/index9/tracked/$f
+       cp -x -- $commit/tree/$f $f
+       git/add $f
 }
 exit ''