Skip to content

Commit

Permalink
Merge branch 'jk/http-push-symref-fix'
Browse files Browse the repository at this point in the history
* jk/http-push-symref-fix:
  http-push: trim trailing newline from remote symref
  • Loading branch information
Junio C Hamano committed Jan 21, 2015
2 parents 17ad371 + f6786c8 commit ea6e82c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit ea6e82c

Please sign in to comment.