Re: [PATCH 1/4] packed-backend: skip checking consistency of empty packed-refs file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



shejialuo <shejialuo@xxxxxxxxx> writes:

> In "load_contents", when the "packed-refs" is empty, we will just return
> the snapshot. However, we would report an error to the user when
> checking the consistency of the empty "packed-refs".

Neither the commit title nor the above paragraph hints that this is
talking about "fsck" part of the packed-refs subsystem.  That leaves
the readers confused when they read "with the runtime behavior"
below.

> We should align with the runtime behavior. As what "load_contents" does,
> let's check whether the file size is zero and if so, we will skip
> checking the consistency and simply return.

How about

	During fsck, an empty "packed-refs" file gives an error;
	this is unwarranted.  We should instead just return an empty
	"snapshot" and let the caller happily declare success, just
	like the code paths that implement the runtime use of the
	file do.

or something?

As to the title

	packed-backend: fsck should allow an empty packed-refs file

is shorter and clearer, I would think.

The code change is trivially correct, I think.  Nicely found.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux