Merge branch 'jk/http-push-symref-fix'
* jk/http-push-symref-fix: http-push: trim trailing newline from remote symref
This commit is contained in:
commit
ea6e82c875
@ -1577,6 +1577,9 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
|
|||||||
if (buffer.len == 0)
|
if (buffer.len == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Cut off trailing newline. */
|
||||||
|
strbuf_rtrim(&buffer);
|
||||||
|
|
||||||
/* If it's a symref, set the refname; otherwise try for a sha1 */
|
/* If it's a symref, set the refname; otherwise try for a sha1 */
|
||||||
if (skip_prefix(buffer.buf, "ref: ", &name)) {
|
if (skip_prefix(buffer.buf, "ref: ", &name)) {
|
||||||
*symref = xmemdupz(name, buffer.len - (name - buffer.buf));
|
*symref = xmemdupz(name, buffer.len - (name - buffer.buf));
|
||||||
|
Loading…
Reference in New Issue
Block a user