From a5282f9eab1b78bd65e5144c81bf0f19b3f9efaf Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Sat, 5 Jun 2021 17:42:05 +0000 Subject: git/{branch,pull}: merge files correctly merge1 would clobber the global '$base' variable, which is not what we wanted. Run it in a subshell with its own env. --- sys/lib/git/common.rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/lib/git/common.rc b/sys/lib/git/common.rc index dbcef04bf..edb95f7d1 100644 --- a/sys/lib/git/common.rc +++ b/sys/lib/git/common.rc @@ -40,7 +40,8 @@ fn present { } # merge1 out theirs base ours -fn merge1 { +fn merge1 {@{ + rfork e n=$pid out=$1 theirs=$2 @@ -59,7 +60,7 @@ fn merge1 { if(! test -f $theirs) theirs=/dev/null if(! ape/diff3 -3 -m $ours $base $theirs > $tmp) - echo merge needed: $out + echo merge needed: $out >[1=2] if(present $ours $base $theirs){ mv $tmp $out @@ -69,6 +70,7 @@ fn merge1 { rm -f $tmp $out git/rm $out } + } } fn gitup{ -- cgit v1.2.3