Re: [PATCH] Produce a nicer output in case of sha1_object_info failures in ls-tree -l

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

 



Alex Riesen <raa.lkml@xxxxxxxxx> writes:

> Junio C Hamano, Thu, Mar 19, 2009 22:55:56 +0100:
>> Alex Riesen <raa.lkml@xxxxxxxxx> writes:
>> > @@ -91,6 +90,7 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen,
>> >  	if (!(ls_options & LS_NAME_ONLY)) {
>> >  		if (ls_options & LS_SHOW_SIZE) {
>> >  			if (!strcmp(type, blob_type)) {
>> > +				unsigned long size = 0;
>> >  				sha1_object_info(sha1, &size);
>> >  				printf("%06o %s %s %7lu\t", mode, type,
>> >  				       abbrev ? find_unique_abbrev(sha1, abbrev)
>> 
>> Hmm, shouldn't you be checking the return value from sha1_object_info()
>> and skipping the printf() altogether instead?
>
> But then I cannot know the name of the failed tree entry.

Why?

	if (sha1_object_info() == OBJ_BAD)
		die("object recorded at tree entry %s is bad", pathname);
	printf ...
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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