diff options
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -4240,7 +4240,35 @@ END if ($r==256) { my $referent = $split_brain ? $dgithead : 'HEAD'; my $diffs = cmdoutput @git, qw(diff --stat), $tree, $dgithead; - fail <<END + + my @mode_changes; + my $raw = cmdoutput @git, + qw(diff --no-renames -z -r --raw), $tree, $dgithead; + my $changed; + foreach (split /\0/, $raw) { + if (defined $changed) { + push @mode_changes, "$changed: $_\n" if $changed; + $changed = undef; + next; + } elsif (m/^:0+ 0+ /) { + $changed = ''; + } elsif (m/^:(?:10*)?(\d+) (?:10*)?(\d+) /) { + $changed = "Mode change from $1 to $2" + } else { + die "$_ ?"; + } + } + if (@mode_changes) { + fail <<END.(join '', @mode_changes).<<END; +HEAD specifies a different tree to $dscfn: +$diffs +END +There is a problem with your source tree (see dgit(7) for some hints). +To see a full diff, run git diff $tree $referent +END + } + + fail <<END; HEAD specifies a different tree to $dscfn: $diffs Perhaps you forgot to build. Or perhaps there is a problem with your |