code: plan9front

Download patch

ref: aa0b6bedf4151dffec81e38b3c166aaac51c04c1
parent: a3cbab3dc2fd16ddbed40ecbe1d884e0bb4988f7
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Oct 15 13:10:20 EDT 2023

git/walk: filter out files from within the .git repo

Bugs in utilities like git/add can accidentally add files
that should be impossible to track; git/walk should just
not print them.

--- a/sys/src/cmd/git/walk.c
+++ b/sys/src/cmd/git/walk.c
@@ -445,6 +445,11 @@
 				idx = realloc(idx, idxsz*sizeof(Idxent));
 			}
 			cleanname(parts[3]);
+			if(strncmp(parts[3], ".git/", 5) == 0){
+				staleidx = 1;
+				free(ln);
+				continue;
+			}
 			idx[nidx].state = *parts[0];
 			idx[nidx].qid = parseqid(parts[1]);
 			idx[nidx].mode = strtol(parts[2], nil, 8);