Skip to content

Commit

Permalink
export: only bind commit if it exists
Browse files Browse the repository at this point in the history
This fixes an edge case with the first commit,
where no parent exists. In that case, we want
to diff against an empty directory.
  • Loading branch information
oridb committed Feb 12, 2021
1 parent 48b5ef5 commit d2149bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions export
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ m=$#commits
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}
Expand Down

0 comments on commit d2149bc

Please sign in to comment.