shithub: git9

Download patch

ref: 91884b5863294fafccdc737182ef5a24fb258e70
parent: f02778f3d7a1d12670995160d16db6cf51ac3db4
author: Ori Bernstein <[email protected]>
date: Tue Mar 24 00:32:08 EDT 2020

don't allow merging a branch to itself

we used to be able to make merge commits from a branch to
itself, or from a branch that was a fast forward of another,
but this is a dumb thing to do.

--- a/merge
+++ b/merge
@@ -37,6 +37,9 @@
 ours=`{git/query HEAD}
 base=`{git/query $theirs ^ ' ' ^ $ours ^ '@'}
 
-merge /mnt/git/object/$ours /mnt/git/object/$base /mnt/git/object/$theirs
+if(~ $base $ours || ~ $base $theirs)
+	die 'nothing to merge, doofus'
 echo $ours >> .git/index9/merge-parents
 echo $theirs >> .git/index9/merge-parents
+
+merge /mnt/git/object/$ours /mnt/git/object/$base /mnt/git/object/$theirs