From 531e758d9c861facd4ebcc8c9b0e4e1443b5665a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sat, 20 Mar 2010 19:55:28 +0100 Subject: ls: remove redundant logic find_unique_abbrev() already returns the full SHA-1 if abbrev = 0, so we can remove the logic that avoids the call. Signed-off-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- builtin/ls-files.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'builtin/ls-files.c') diff --git a/builtin/ls-files.c b/builtin/ls-files.c index b065061392..c0fbcdcf4f 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -153,8 +153,7 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce) printf("%s%06o %s %d\t", tag, ce->ce_mode, - abbrev ? find_unique_abbrev(ce->sha1,abbrev) - : sha1_to_hex(ce->sha1), + find_unique_abbrev(ce->sha1,abbrev), ce_stage(ce)); } write_name_quoted(ce->name + offset, stdout, line_terminator); @@ -176,9 +175,7 @@ static int show_one_ru(struct string_list_item *item, void *cbdata) if (!ui->mode[i]) continue; printf("%s%06o %s %d\t", tag_resolve_undo, ui->mode[i], - abbrev - ? find_unique_abbrev(ui->sha1[i], abbrev) - : sha1_to_hex(ui->sha1[i]), + find_unique_abbrev(ui->sha1[i], abbrev), i + 1); write_name_quoted(path + offset, stdout, line_terminator); } -- cgit v1.2.1