Skip to content

Commit ea6e82c

Browse files
committed
Merge branch 'jk/http-push-symref-fix'
* jk/http-push-symref-fix: http-push: trim trailing newline from remote symref
2 parents 17ad371 + f6786c8 commit ea6e82c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

http-push.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,9 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
15771577
if (buffer.len == 0)
15781578
return;
15791579

1580+
/* Cut off trailing newline. */
1581+
strbuf_rtrim(&buffer);
1582+
15801583
/* If it's a symref, set the refname; otherwise try for a sha1 */
15811584
if (skip_prefix(buffer.buf, "ref: ", &name)) {
15821585
*symref = xmemdupz(name, buffer.len - (name - buffer.buf));

0 commit comments

Comments
 (0)