From: Junio C Hamano Date: Wed, 21 Jan 2015 01:31:50 +0000 (-0800) Subject: Merge branch 'jk/http-push-symref-fix' X-Git-Tag: v2.3.0-rc1~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ea6e82c875a110f93d43cb246b76c55fb8c57de6?hp=17ad37112de878e7f946d202f830c95907d40f70 Merge branch 'jk/http-push-symref-fix' * jk/http-push-symref-fix: http-push: trim trailing newline from remote symref --- diff --git a/http-push.c b/http-push.c index 952f8ede49..0beb7ab67f 100644 --- a/http-push.c +++ b/http-push.c @@ -1577,6 +1577,9 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1) if (buffer.len == 0) return; + /* Cut off trailing newline. */ + strbuf_rtrim(&buffer); + /* If it's a symref, set the refname; otherwise try for a sha1 */ if (skip_prefix(buffer.buf, "ref: ", &name)) { *symref = xmemdupz(name, buffer.len - (name - buffer.buf));