diff options
author | Erik Faye-Lund <kusmabite@googlemail.com> | 2010-03-20 21:55:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-22 02:23:44 +0300 |
commit | 531e758d9c861facd4ebcc8c9b0e4e1443b5665a (patch) | |
tree | 0782bcd9e4d0133d3acec2215942bbc9f31c265b /builtin/ls-tree.c | |
parent | 28a53178fcd3c9a6576b20040982ca0b9e972f42 (diff) |
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 <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-tree.c')
-rw-r--r-- | builtin/ls-tree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index 4484185afc..dc86b0d9a9 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -103,13 +103,11 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen, } else strcpy(size_text, "-"); printf("%06o %s %s %7s\t", mode, type, - abbrev ? find_unique_abbrev(sha1, abbrev) - : sha1_to_hex(sha1), + find_unique_abbrev(sha1, abbrev), size_text); } else printf("%06o %s %s\t", mode, type, - abbrev ? find_unique_abbrev(sha1, abbrev) - : sha1_to_hex(sha1)); + find_unique_abbrev(sha1, abbrev)); } write_name_quotedpfx(base + chomp_prefix, baselen - chomp_prefix, pathname, stdout, line_termination); |