From: Mike Hommey Date: Thu, 16 Apr 2020 11:34:04 GMT Subject: Re: Order of operations at the end of fast-import? Message-ID: <20200416113404.pr2hzihavdvtfjh3@glandium.org> In-Reply-To: <20200416042449.ztgyrdunsrzt7avp@glandium.org> On Thu, Apr 16, 2020 at 01:24:49PM +0900, Mike Hommey wrote: > Hi, > > I just noticed that the order of operations at the end of fast-import > are: > - end_packfile > - dump_branches > - dump_tags > > The first may create loose objects if the pack is small (per > fastimport.unpackLimit, defaulting to 100). The latter two create refs. > > There seems to be a theoretical race condition here, if something else > triggers a gc at the "wrong" time, the loose objects might be cleaned up > and the branches/tags refs become dangling. Come to think of it, this is only a problem with --prune=now, and the same applies to loose objects created with git add, git write-tree, git-commit-tree. Mike