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

2013-08-26 Thread Christian Couder
From: Johannes Sixt j...@kdbg.org Am 25.08.2013 21:44, schrieb Christian Couder: What about: die(Objects must be of the same type.\n '%s' points to a replaced object of type '%s'\n while '%s' points to a replacement object of type

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

2013-08-25 Thread Christian Couder
Users replacing an object with one of a different type were not prevented to do so, even if it was obvious, and stated in the doc, that bad things would result from doing that. To avoid mistakes, it is better to just forbid that though. There is no case where one object can be replaced with one

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

2013-08-25 Thread Johannes Sixt
Am 25.08.2013 15:06, schrieb Christian Couder: @@ -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); +

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

2013-08-25 Thread Christian Couder
From: Johannes Sixt j...@kdbg.org Am 25.08.2013 15:06, schrieb Christian Couder: @@ -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 =

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

2013-08-25 Thread Johannes Sixt
Am 25.08.2013 21:44, schrieb Christian Couder: What about: die(Objects must be of the same type.\n '%s' points to a replaced object of type '%s'\n while '%s' points to a replacement object of type '%s'., Much better! -- Hannes -- To