chiark / gitweb /
dgit: Make commit_getclogp not leave a lot of detritus in .git/dgit
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 83013b898448046d69711064908354b98736b7a9..606abb5881ccd2a75736775cf04688a315c91d0d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -985,7 +985,7 @@ sub commit_getclogp ($) {
     my $memo = $commit_getclogp_memo{$objid};
     return $memo if $memo;
     
-    my $mclog = dgit_privdir()."clog-$objid";
+    my $mclog = dgit_privdir()."clog";
     runcmd shell_cmd "exec >$mclog", @git, qw(cat-file blob),
        "$objid:debian/changelog";
     $commit_getclogp_memo{$objid} = parsechangelog("-l$mclog");
@@ -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;