Re: [PATCH] notes: Disallow reusing non-blob as a note object

2014-02-14 Thread Eric Sunshine
On Wed, Feb 12, 2014 at 4:54 AM, Johan Herland jo...@herland.net wrote: Currently git notes add -C $object will read the raw bytes from $object, and then copy those bytes into the note object, which is hardcoded to be of type blob. This means that if the given $object is a non-blob (e.g. tree

Re: [PATCH] notes: Disallow reusing non-blob as a note object

2014-02-14 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: + if (type != OBJ_BLOB) { + free(buf); + die(_(Cannot read note data from non-blob object '%s'.), arg); The way this diagnostic is worded, it sound as if the 'read' failed rather than that the user specified

[PATCH] notes: Disallow reusing non-blob as a note object

2014-02-12 Thread Johan Herland
Currently git notes add -C $object will read the raw bytes from $object, and then copy those bytes into the note object, which is hardcoded to be of type blob. This means that if the given $object is a non-blob (e.g. tree or commit), the raw bytes from that object is copied into a blob object.