]> git.lizzy.rs Git - plan9front.git/commitdiff
git/add: clear qid cache as side effect
authorOri Bernstein <ori@eigenstate.org>
Sat, 12 Jun 2021 14:57:58 +0000 (14:57 +0000)
committerOri Bernstein <ori@eigenstate.org>
Sat, 12 Jun 2021 14:57:58 +0000 (14:57 +0000)
this is an occasionally useful side effect when
doing surgery on repos, so let's have it.

sys/src/cmd/git/add [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a51e154..53e24d9
@@ -31,9 +31,7 @@ for(f in $files){
                # We don't want a matching qid, so that
                # git/walk doesn't think this came from
                # a checkout.
-               if(! test -e $addpath)
-                       if(~ $add 'tracked' || test -e $gitfs/HEAD/tree/$f)
-                               touch $addpath
+               echo -n > $addpath
                rm -f $delpath
        }
 }