summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2022-10-21 15:27:14 +0000
committerOri Bernstein <ori@eigenstate.org>2022-10-21 15:27:14 +0000
commitdfee08d50df674cd76f74320bc9c8bc6a4a95f1e (patch)
tree23bbb4666b45e86d4ebd6494c1377abd12aaae7f /sys/src/cmd
parentf9df0bd2821c302cb13b694842e802cd9e2bc402 (diff)
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.
Diffstat (limited to 'sys/src/cmd')
-rw-r--r--sys/src/cmd/git/walk.c10
1 files changed, 6 insertions, 4 deletions
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))