ref: 2f01287c83dec1310f6421e5ae4bae9e97440f4f
parent: 451932e92637ccd84d77e4b921460590612f317c
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Nov 22 14:48:58 EST 2023
git/walk: skip all paths with '.git/' when creating the index
--- a/sys/src/cmd/git/walk.c
+++ b/sys/src/cmd/git/walk.c
@@ -234,11 +234,17 @@
if(path == nil)
sysfatal("smprint: %r");
+ cleanname(path);
+ if(strncmp(path, ".git/", 5) == 0){
+ free(path);
+ return 0;
+ }
ret = 0;
isdir = d->qid.type & QTDIR;
- cleanname(path);
- if((printflg & Uflg) == 0 && !indexed(path, isdir))
+ if((printflg & Uflg) == 0 && !indexed(path, isdir)){
+ free(path);
return 0;
+ }
if(isdir){
ret = loadwdir(path);
free(path);
@@ -267,7 +273,6 @@
d = nil;
e = nil;
ret = -1;
-
cleanname(path);
if(strncmp(path, ".git/", 5) == 0)
return 0;
--
⑨