diff --git a/sys/src/cmd/git/diff b/sys/src/cmd/git/diff index 075ea3ee9..64206c4a7 100644 --- a/sys/src/cmd/git/diff +++ b/sys/src/cmd/git/diff @@ -26,12 +26,16 @@ fn lsdirty { git/query -c $commit HEAD | subst '^..' } +mntgen /mnt/scratch +bind $branch/tree/ /mnt/scratch/a +bind . /mnt/scratch/b +echo diff `{git/query $commit} uncommitted for(f in `$nl{lsdirty | sort | uniq}){ - orig=$branch/tree/$f - if(! test -f $orig) + cd /mnt/scratch + if(! test -f a/$f) orig=/dev/null - if(! test -f $f) + if(! test -f b/$f) f=/dev/null - diff -u $orig $f + diff -u a/$f b/$f } exit '' diff --git a/sys/src/cmd/git/import b/sys/src/cmd/git/import index c89d52d6b..1ce614a20 100755 --- a/sys/src/cmd/git/import +++ b/sys/src/cmd/git/import @@ -45,7 +45,7 @@ fn apply @{ state="body" next } - (state=="headers" || state=="body") && (/^diff/ || /^---[ ]*$/){ + (state=="headers" || state=="body") && (/^diff / || /^--- /){ state="diff" } state=="body" {