- printf("%06o %s %s\t", mode, type, sha1_to_hex(sha1));
- write_name_quoted(base, baselen, pathname, line_termination, stdout);
+ if (!(ls_options & LS_NAME_ONLY))
+ printf("%06o %s %s\t", mode, type, sha1_to_hex(sha1));
+ write_name_quoted(base + chomp_prefix, baselen - chomp_prefix,
+ pathname,
+ line_termination, stdout);