chiark / gitweb /
directory refactor: open_main_gitattrs confesses if $maindir not set
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 83013b898448046d69711064908354b98736b7a9..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: $!";
@@ -5020,8 +5021,8 @@ END
     changedir $maindir;
     # When we no longer need to support squeeze, use --create-reflog
     # instead of this:
-    ensuredir ".git/logs/refs/dgit-intern";
-    my $makelogfh = new IO::File ".git/logs/refs/$splitbraincache", '>>'
+    ensuredir "$maindir_gitcommon/logs/refs/dgit-intern";
+    my $makelogfh = new IO::File "$maindir_gitcommon/logs/refs/$splitbraincache", '>>'
       or die $!;
 
     my $oldcache = git_get_ref "refs/$splitbraincache";
@@ -5499,7 +5500,7 @@ sub quilt_check_splitbrain_cache ($$) {
     my $child = open GC, "-|";  defined $child or die $!;
     if (!$child) {
        chdir $maindir or die $!;
-       if (!stat ".git/logs/refs/$splitbraincache") {
+       if (!stat "$maindir_gitcommon/logs/refs/$splitbraincache") {
            $! == ENOENT or die $!;
            printdebug ">(no reflog)\n";
            exit 0;