shithub: git9

Download patch

ref: 6794de8f796f03ac666c80cec116c60e33206ff4
parent: ba26692dbfcbea5231d02edd318a5dfbf8f22db3
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Dec 12 15:09:19 EST 2020

commit,compat,merge: split walk results on newlines

This solves issues with filenames containing spaces.

--- a/commit
+++ b/commit
@@ -131,7 +131,7 @@
 	cat /mnt/git/HEAD/msg >$msgfile.tmp
 }
 
-files=`{git/walk -c `{cleanname $gitrel/$*}}
+files=`$nl{git/walk -c `$nl{cleanname $gitrel/$*}}
 if(~ $status '' || ~ $#files 0 && ! test -f .git/index9/merge-parents)
 	die 'nothing to commit' $status
 @{
--- a/compat
+++ b/compat
@@ -108,7 +108,7 @@
 		filter=cat
 	if not
 		filter='-e(^|/)'^$*^'$'
-	for(b in `{cd $gitroot/.git/refs/ && walk -f})
+	for(b in `$nl{cd $gitroot/.git/refs/ && walk -f})
 		echo `{cat $gitroot/.git/refs/$b} refs/$b 
 }
 
--- a/merge
+++ b/merge
@@ -7,7 +7,7 @@
 	basebr=$2/tree
 	theirbr=$3/tree
 
-	all=`{walk -f $ourbr $basebr $theirbr | \
+	all=`$nl{walk -f $ourbr $basebr $theirbr | \
 		subst -g '^('$ourbr'|'$basebr'|'$theirbr')/*' | sort | uniq}
 	for(f in $all){
 		ours=$ourbr/$f