Re: [PATCH 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:29 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> If we don't have to strip trailing '/' from the submodule path, then >> don't allocate and copy the submodule name. > > Makes sense. > >> int resolve_gitlink_ref(const char *path, const char

Re: [PATCH 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases

2016-06-07 Thread Junio C Hamano
Michael Haggerty writes: > If we don't have to strip trailing '/' from the submodule path, then > don't allocate and copy the submodule name. Makes sense. > int resolve_gitlink_ref(const char *path, const char *refname, unsigned char > *sha1) > { > - int len =

[PATCH 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases

2016-06-03 Thread Michael Haggerty
If we don't have to strip trailing '/' from the submodule path, then don't allocate and copy the submodule name. Signed-off-by: Michael Haggerty --- refs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/refs.c b/refs.c index