diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-03-21 10:08:25 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-21 10:21:57 -0700 |
commit | 6fda5e5180c2e7c130978361aea53b4e66f36823 (patch) | |
tree | 89df3a31883fe84ae06d1c05f29fa823614eef87 /builtin-fsck.c | |
parent | a8c40471ab0851bf9a58f7dc76f121258e0690e2 (diff) | |
download | git-6fda5e5180c2e7c130978361aea53b4e66f36823.tar.gz |
Initialize tree descriptors with a helper function rather than by hand.
This removes slightly more lines than it adds, but the real reason for
doing this is that future optimizations will require more setup of the
tree descriptor, and so we want to do it in one place.
Also renamed the "desc.buf" field to "desc.buffer" just to trigger
compiler errors for old-style manual initializations, making sure I
didn't miss anything.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r-- | builtin-fsck.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c index b8e71b640b..21f1f9e91d 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -227,8 +227,7 @@ static int fsck_tree(struct tree *item) const char *o_name; const unsigned char *o_sha1; - desc.buf = item->buffer; - desc.size = item->size; + init_tree_desc(&desc, item->buffer, item->size); o_mode = 0; o_name = NULL; @@ -242,7 +241,7 @@ static int fsck_tree(struct tree *item) if (strchr(name, '/')) has_full_path = 1; - has_zero_pad |= *(char *)desc.buf == '0'; + has_zero_pad |= *(char *)desc.buffer == '0'; update_tree_entry(&desc); switch (mode) { |