chiark / gitweb /
Dgit.pm: parsecontrol: Improve error message for failed open
[dgit.git] / Debian / Dgit.pm
index 80b693b68990be00a1f5d003a331d25e5fcefb90..5a13e0a14275030e7f0a8296faa1af4ec8d83b3f 100644 (file)
@@ -651,7 +651,7 @@ sub parsecontrolfh ($$;$) {
 sub parsecontrol {
     my ($file, $desc, $allowsigned) = @_;
     my $fh = new IO::Handle;
-    open $fh, '<', $file or die "$file: $!";
+    open $fh, '<', $file or fail "open $file ($desc): $!";
     my $c = parsecontrolfh($fh,$desc,$allowsigned);
     $fh->error and confess $!;
     close $fh;
@@ -737,12 +737,13 @@ sub reflog_cache_insert ($$$) {
        # git update-ref doesn't always update, in this case.  *sigh*
        my $authline = (ucfirst _us()).
            ' <'._us().'@example.com> 1000000000 +0000';
-       my $dummy = make_commit_text <<END;
+       my $dummy = make_commit_text <<ENDU.<<END;
 tree $tree
 parent $value
 author $authline
 committer $authline
 
+ENDU
 Dummy commit - do not use
 END
        runcmd qw(git update-ref -m), _us()." - dummy", $ref, $dummy;