shithub: git9

Download patch

ref: d2149bc37264e9a32700f174eeb64023a567420c
parent: 48b5ef5d7e0f59e0a9e8c4d00676cfb66725407d
author: Ori Bernstein <[email protected]>
date: Fri Feb 12 14:33:42 EST 2021

export: only bind commit if it exists

This fixes an edge case with the first commit,
where no parent exists. In that case, we want
to diff against an empty directory.

--- a/export
+++ b/export
@@ -30,14 +30,16 @@
 mntgen /mnt/scratch >[2]/dev/null || status=''
 for(c in $commits){
 	cp=`{git/query -p $c}
-	pp=`{git/query -p $c'^'}
+	pp=`{git/query -p $c'~'}
 	fc=`$nl{git/query -c $c~ $c | sed 's/^..//'}
 
 	@{
 		rfork n
 		cd /mnt/scratch
-		bind $pp/tree a
-		bind $cp/tree b
+		if(test -d $pp/tree)
+			bind $pp/tree a
+		if(test -d $cp/tree)
+			bind $cp/tree b
 		
 		echo From $c
 		echo From: `{cat $cp/author}