git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] fsck: minor typofix
@ 2011-06-27 17:50 Junio C Hamano
  2011-06-27 17:50 ` [PATCH 2/3] fsck: clarify semantics of mark_object_reachable() Junio C Hamano
  2011-06-27 17:50 ` [PATCH 3/3] object: reclaim one bit in the flags field Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Junio C Hamano @ 2011-06-27 17:50 UTC (permalink / raw)
  To: git

There are two places that diagnose the same kind of error in mark_object(),
that receives an object, the type the object is expected to be, and the
object that refers to it (IOW, the reason why we want to make sure that
the first object is in a good order). When the object that is referred to
is missing, we report "broken link from X; broken link to Y".

However, one of the two places, that is used much less often, said "broken
link from X; broken link from Y".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 This rarely used codepath is triggered only when fsck_walk() calls this
 function that is set as a callback in traverse_one_object() from one of
 the type specific scanners, e.g. fsck_walk_tree(), and an object that is
 referred to is of a wrong type, e.g. a tree entry with mode 100644 is
 looked up with lookup_blob(), and the type of the named object is already
 known to us to be something different. The look-up code issues an unrelated
 error message in such a case, but then this codepath does not know what the
 object name of the offending object was.
---
 builtin/fsck.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/fsck.c b/builtin/fsck.c
index 5ae0366..64f30d4 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -83,7 +83,7 @@ static int mark_object(struct object *obj, int type, void *data)
 		/* ... these references to parent->fld are safe here */
 		printf("broken link from %7s %s\n",
 			   typename(parent->type), sha1_to_hex(parent->sha1));
-		printf("broken link from %7s %s\n",
+		printf("broken link to %7s %s\n",
 			   (type == OBJ_ANY ? "unknown" : typename(type)), "unknown");
 		errors_found |= ERROR_REACHABLE;
 		return 1;
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-27 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 17:50 [PATCH 1/3] fsck: minor typofix Junio C Hamano
2011-06-27 17:50 ` [PATCH 2/3] fsck: clarify semantics of mark_object_reachable() Junio C Hamano
2011-06-27 17:50 ` [PATCH 3/3] object: reclaim one bit in the flags field Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).