Thread (11 messages) flat view 11 messages, 2 authors, 2016-06-15

Re: [PATCH 1/5] replace: forbid replacing an object with one of a different type

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:58:30

Am 25.08.2013 15:06, schrieb Christian Couder:
quoted hunk ↗ jump to hunk
@@ -100,6 +101,15 @@ static int replace_object(const char *object_ref, const char *replace_ref,
 	if (check_refname_format(ref, 0))
 		die("'%s' is not a valid ref name.", ref);
 
+	obj_type = sha1_object_info(object, NULL);
+	repl_type = sha1_object_info(repl, NULL);
+	if (obj_type != repl_type)
+		die("Objects must be of the same type.\n"
+		    "Object ref '%s' is of type '%s'\n"
Is it really an "Object ref", not just an "Object"?
+		    "while replace ref '%s' is of type '%s'.",
And here:

		"while replacement object '%s' is of type '%s'.",

BTW, I appreciate your choice of where in the sentence the line breaks are.
+		    object_ref, typename(obj_type),
+		    replace_ref, typename(repl_type));
+
 	if (read_ref(ref, prev))
 		hashclr(prev);
 	else if (!force)
-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help