diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-10 00:54:19 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-11 00:40:08 +0100 |
commit | 7fdea3dc94e1ea2615b304a7833b951425b2357f (patch) | |
tree | 367b52da238f996b466439713379e59e90c40baf /dgit | |
parent | 3d70fbf05b9b0ff766dd2f837e3ed962eef36cf4 (diff) |
dgit: HEAD/.dsc mismatch error: Much better message
Closes:#809516.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -3211,17 +3211,20 @@ END my ($tree,$dir) = mktree_in_ud_from_only_subdir(); check_for_vendor_patches() if madformat($dsc->{format}); changedir '../../../..'; - my $diffopt = $debuglevel>0 ? '--exit-code' : '--quiet'; - my @diffcmd = (@git, qw(diff), $diffopt, $tree, $dgithead); + my @diffcmd = (@git, qw(diff --quiet), $tree, $dgithead); debugcmd "+",@diffcmd; $!=0; $?=-1; my $r = system @diffcmd; if ($r) { if ($r==256) { - fail "$dscfn specifies a different tree to your HEAD commit;". - " perhaps you forgot to build". - ($diffopt eq '--exit-code' ? "" : - " (run with -D to see full diff output)"); + my $diffs = cmdoutput @git, qw(diff --stat), $tree, $dgithead; + fail <<END +HEAD specifies a different tree to $dscfn: +$diffs +Perhaps you forgot to build. Or perhaps there is a problem with your + source tree (see dgit(7) for some hints). To see a full diff, run + git diff $tree HEAD +END } else { failedcmd @diffcmd; } |