From: Ian Jackson Date: Wed, 2 Aug 2017 18:29:53 +0000 (+0100) Subject: worktree support: dgit: Fix for .git/logs/refs/ X-Git-Tag: archive/debian/4.1~23 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a820bbcc18d1cc4c8719185d61aef5ab63e2247b;p=dgit.git worktree support: dgit: Fix for .git/logs/refs/ Experimentally, both the common dir and the worktree's git dir have a .git/logs. But, as might be expected, the worktree's one has the reflog for its HEAD and not any of the refs/ reflogs. Implicitly, we are deciding here that the dgit quilt cache is shared between all worktrees. That seems fine. I think we don't ever rely on its actual current value, so even concurrent dgit runs ought to be fine. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index 83013b89..6c1d5bc1 100755 --- a/dgit +++ b/dgit @@ -5020,8 +5020,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 +5499,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;