summaryrefslogtreecommitdiff
path: root/sys/src/cmd/git/branch
diff options
context:
space:
mode:
authorglenda <glenda@9front.local>2021-06-05 18:50:20 +0000
committerglenda <glenda@9front.local>2021-06-05 18:50:20 +0000
commit706aad3d94ee4d9ff93c8c21398f0bb471a438da (patch)
tree69a8e6864b44ee39a4b282ac0c7b59efe0f6c3d3 /sys/src/cmd/git/branch
parenta5282f9eab1b78bd65e5144c81bf0f19b3f9efaf (diff)
git/branch: merge correct set of files
we were switching branches before we got the full list of modified files, which could garble what we were trying to merge.
Diffstat (limited to 'sys/src/cmd/git/branch')
-rwxr-xr-xsys/src/cmd/git/branch6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/cmd/git/branch b/sys/src/cmd/git/branch
index f2b785a5d..f1b46717f 100755
--- a/sys/src/cmd/git/branch
+++ b/sys/src/cmd/git/branch
@@ -60,9 +60,10 @@ if(~ $#newbr 0){
commit=`{git/query $base} || die 'branch does not exist:' $base
if(~ $new */*)
mkdir -p .git/`{basename -d $new}
-echo $commit > .git/$new
-if(! ~ $#stay 0)
+if(! ~ $#stay 0){
+ echo $commit > .git/$new
exit
+}
basedir=`{git/query -p $base}
dirtypaths=()
cleanpaths=($modified $deleted)
@@ -79,6 +80,7 @@ if(! ~ $#cleandirs 0){
mkdir -p $cleandirs
mkdir -p .git/index9/tracked/$cleandirs
}
+echo $commit > .git/$new
for(m in $cleanpaths){
# Modifications can turn a file into
# a directory, or vice versa, so we