From dfee08d50df674cd76f74320bc9c8bc6a4a95f1e Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Fri, 21 Oct 2022 15:27:14 +0000 Subject: git/walk: don't list untracked files after removal git/walk had some confusing behavior, where git/add of a file and then immediate removal would leave it in the list of files as 'removed'. This was harmless, but confusing to users. Now, 'git/add' and 'git/rm' without a commit in between will not list the file as removed. --- sys/src/cmd/git/walk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/src/cmd/git') diff --git a/sys/src/cmd/git/walk.c b/sys/src/cmd/git/walk.c index 50a227e21..b6a2d633f 100644 --- a/sys/src/cmd/git/walk.c +++ b/sys/src/cmd/git/walk.c @@ -295,10 +295,12 @@ nextarg: if(!quiet && (printflg & Tflg)) print("%s%s\n", tstr, p); }else{ - if(d == nil || access(rpath, AEXIST) == 0){ - dirty |= Rflg; - if(!quiet && (printflg & Rflg)) - print("%s%s\n", rstr, p); + if(d == nil || access(rpath, AEXIST) == 0 ){ + if(access(bpath, AEXIST) == 0){ + dirty |= Rflg; + if(!quiet && (printflg & Rflg)) + print("%s%s\n", rstr, p); + } }else if(access(bpath, AEXIST) == -1) { dirty |= Aflg; if(!quiet && (printflg & Aflg)) -- cgit v1.2.3