chiark / gitweb /
directory refactor: open_main_gitattrs confesses if $maindir not set
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 3 Aug 2017 07:31:12 +0000 (08:31 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 3 Aug 2017 21:41:51 +0000 (22:41 +0100)
This improves the error message considerably for "didn't call
record_maindir" bugs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 6c1d5bc15e52d51187fb9d9b964e9de2514ab7c6..8b638c476f091bba7333dff8723fca79e6347daf 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3314,6 +3314,7 @@ sub ensure_setup_existing_tree () {
 }
 
 sub open_main_gitattrs () {
+    confess 'internal error no maindir' unless defined $maindir;
     my $gai = new IO::File "$maindir_gitcommon/info/attributes"
        or $!==ENOENT
        or die "open $maindir_gitcommon/info/attributes: $!";