shithub: riscv

Download patch

ref: a3c75553b4c50247ce22a4da4d2a87c10d5b0835
parent: 9e79d829051878f0f55a9836306ba206a264d5a8
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Sep 10 20:05:39 EDT 2023

git/fs: preserve mode bits when walking branch dirs

when walking through a nested branch directory, we may not
set the DMDIR bit and confuse things.

--- a/sys/src/cmd/diff/merge3.c
+++ b/sys/src/cmd/diff/merge3.c
@@ -128,7 +128,6 @@
 			il++;
 			ir++;
 			status = "conflict";
-abort();
 		}else if(rc == nil || (lc != nil && lx < rx)){
 			fetch(l, l->ixold, ln, lc->oldx-1, l->input[0], "");
 			fetch(l, l->ixnew, lc->newx, lc->newy, l->input[1], "");
--- a/sys/src/cmd/git/fs.c
+++ b/sys/src/cmd/git/fs.c
@@ -621,6 +621,8 @@
 			q->path = qpath(o, Qbranch, c->obj->id, Qcommit);
 		else
 			e = Eexist;
+		if(d != nil)
+			c->mode = d->mode & ~0222;
 		free(d);
 		break;
 	case Qobject: