]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/repo-structure-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Mar 2026 21:36:56 +0000 (14:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Mar 2026 21:36:56 +0000 (14:36 -0700)
Code clean-up.

* jk/repo-structure-cleanup:
  repo: remove unnecessary variable shadow

1  2 
builtin/repo.c

diff --cc builtin/repo.c
index f943be74510158149729131fe06c8b0ff83124e1,e952778bbf8dd63a5e1e9ad6a15132a46a0cfded..fae1141cff2e3123dc2b56259b7530ca00ff2e52
@@@ -442,27 -274,14 +442,26 @@@ static void stats_table_print_structure
        for_each_string_list_item(item, &table->rows) {
                struct stats_table_entry *entry = item->util;
                const char *value = "";
 +              const char *unit = "";
  
                if (entry) {
-                       struct stats_table_entry *entry = item->util;
                        value = entry->value;
 +                      if (entry->unit)
 +                              unit = entry->unit;
                }
  
 -              printf("| %-*s | %*s |\n", name_col_width, item->string,
 -                     value_col_width, value);
 +              strbuf_reset(&buf);
 +              strbuf_addstr(&buf, "| ");
 +              strbuf_utf8_align(&buf, ALIGN_LEFT, name_col_width, item->string);
 +              strbuf_addstr(&buf, " | ");
 +              strbuf_utf8_align(&buf, ALIGN_RIGHT, value_col_width, value);
 +              strbuf_addch(&buf, ' ');
 +              strbuf_utf8_align(&buf, ALIGN_LEFT, unit_col_width, unit);
 +              strbuf_addstr(&buf, " |");
 +              printf("%s\n", buf.buf);
        }
 +
 +      strbuf_release(&buf);
  }
  
  static void stats_table_clear(struct stats_table *table)