зеркало из https://github.com/microsoft/git.git
Merge branch 'jk/revision-squelch-gcc-warning'
Warning fix. * jk/revision-squelch-gcc-warning: add_pending_object_with_path(): work around "gcc -O3" complaint
This commit is contained in:
Коммит
4677587e57
|
@ -316,9 +316,10 @@ static void add_pending_object_with_path(struct rev_info *revs,
|
||||||
revs->no_walk = 0;
|
revs->no_walk = 0;
|
||||||
if (revs->reflog_info && obj->type == OBJ_COMMIT) {
|
if (revs->reflog_info && obj->type == OBJ_COMMIT) {
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
int len = interpret_branch_name(name, 0, &buf, &options);
|
size_t namelen = strlen(name);
|
||||||
|
int len = interpret_branch_name(name, namelen, &buf, &options);
|
||||||
|
|
||||||
if (0 < len && name[len] && buf.len)
|
if (0 < len && len < namelen && buf.len)
|
||||||
strbuf_addstr(&buf, name + len);
|
strbuf_addstr(&buf, name + len);
|
||||||
add_reflog_for_walk(revs->reflog_info,
|
add_reflog_for_walk(revs->reflog_info,
|
||||||
(struct commit *)obj,
|
(struct commit *)obj,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче