diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-01-20 17:31:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-01-20 17:31:50 -0800 |
commit | ea6e82c875a110f93d43cb246b76c55fb8c57de6 (patch) | |
tree | b8d684060e94901b1808cf02b5a0defe386f1f54 /http-push.c | |
parent | Merge branch 'ak/show-branch-usage-string' (diff) | |
parent | http-push: trim trailing newline from remote symref (diff) | |
download | tgif-ea6e82c875a110f93d43cb246b76c55fb8c57de6.tar.xz |
Merge branch 'jk/http-push-symref-fix'
* jk/http-push-symref-fix:
http-push: trim trailing newline from remote symref
Diffstat (limited to 'http-push.c')
-rw-r--r-- | http-push.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)); |