read_sha1_file(): get rid of read_sha1_file_repl() madness

Most callers want to silently get a replacement object, and they do not
care what the real name of the replacement object is.  Worse yet, no sane
interface to return the underlying object without replacement is provided.

Remove the function and make only the few callers that want the name of
the replacement object find it themselves.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2011-05-15 12:54:52 -07:00
parent abb25ac365
commit 4bbf5a2615
4 changed files with 9 additions and 17 deletions

View File

@ -188,8 +188,8 @@ struct object *parse_object(const unsigned char *sha1)
unsigned long size;
enum object_type type;
int eaten;
const unsigned char *repl;
void *buffer = read_sha1_file_repl(sha1, &type, &size, &repl);
const unsigned char *repl = lookup_replace_object(sha1);
void *buffer = read_sha1_file(sha1, &type, &size);
if (buffer) {
struct object *obj;