Re: [PATCH] cat-file --batch / --batch-check: do not exit if hashes are missing

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Sixt <j.sixt@...>
Cc: <git@...>
Date: Monday, June 9, 2008 - 2:21 pm

Johannes Sixt wrote:

An empty object name is actually not an error but just yields "SP 
missing".  The "if (!obj_name) return 1;" statement doesn't dereference 
obj_name, so it checks for null pointers.  However, batch_one_object 
gets called with buf.buf as its obj_name parameter, which according to 
api-strbuf.txt is never NULL.  So probably the check is pointless and 
can be removed (the tests still pass); someone more knowledgeable than 
me should confirm this though.

(FWIW, perhaps the original author intended to catch empty input this 
way, but I'm not convinced that this is even sensible.)

Unrelatedly, does anyone know how to stop sha1_object_info from barfing 
on non-existent hashes?  It causes the annoying "error: unable to find 
000..." on stderr if you run "echo 
0000000000000000000000000000000000000000 | git-cat-file --batch-check".

-- Lea
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] cat-file --batch / --batch-check: do not exit if..., Lea Wiemann, (Mon Jun 9, 2:21 pm)
Re: [PATCH] cat-file --batch / --batch-check: do not exit if..., Johannes Schindelin, (Sun Jun 8, 7:34 pm)
Re: [PATCH] cat-file --batch / --batch-check: do not exit if..., Johannes Schindelin, (Sun Jun 8, 9:02 pm)