Commit f1f9b45d by Yuang Li

fix test failures

parent b20f013c
......@@ -21,6 +21,7 @@
#include "repository.h"
#include "refs.h"
#include "transports/smart.h"
#include <limits.h>
static int maybe_want(git_remote *remote, git_remote_head *head, git_refspec *tagspec, git_remote_autotag_option_t tagopt)
{
......@@ -175,7 +176,8 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
git_transport *t = remote->transport;
remote->need_pack = 0;
remote->nego.depth = opts->unshallow ? INT_MAX : opts->depth;
remote->nego.depth = (opts && !opts->unshallow) ? opts->depth : INT_MAX;
if (filter_wants(remote, opts) < 0)
return -1;
......@@ -184,7 +186,7 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
if (!remote->need_pack)
return 0;
if (opts->unshallow && opts->depth > 0) {
if (opts && opts->unshallow && opts->depth > 0) {
git_error_set(GIT_ERROR_INVALID, "options '--depth' and '--unshallow' cannot be used together");
return -1;
}
......
......@@ -133,7 +133,7 @@ int git_grafts_parse(git_grafts *grafts, const char *content, size_t contentlen)
const char *line_start = parser.line, *line_end = parser.line + parser.line_len;
git_oid graft_oid;
if ((error = git_oid_fromstrn(&graft_oid, line_start, GIT_OID_SHA1_HEXSIZE)) < 0) {
if ((error = git_oid__fromstrn(&graft_oid, line_start, GIT_OID_SHA1_HEXSIZE, GIT_OID_SHA1)) < 0) {
git_error_set(GIT_ERROR_GRAFTS, "invalid graft OID at line %" PRIuZ, parser.line_num);
goto error;
}
......@@ -143,7 +143,7 @@ int git_grafts_parse(git_grafts *grafts, const char *content, size_t contentlen)
git_oid *id = git_array_alloc(parents);
GIT_ERROR_CHECK_ALLOC(id);
if ((error = git_oid_fromstrn(id, ++line_start, GIT_OID_SHA1_HEXSIZE)) < 0) {
if ((error = git_oid__fromstrn(id, ++line_start, GIT_OID_SHA1_HEXSIZE, GIT_OID_SHA1)) < 0) {
git_error_set(GIT_ERROR_GRAFTS, "invalid parent OID at line %" PRIuZ, parser.line_num);
goto error;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment