提交 9e5b80cd 编写于 作者: J Junio C Hamano

Squelch overzealous "ignoring dangling symref" in an empty repository

057e7138 (Warn use of "origin" when remotes/origin/HEAD is dangling,
2009-02-08) tried to warn dangling refs/remotes/origin/HEAD only when
"origin" was used to refer to it.  There was one corner case a symref is
expected to be dangling and this warning is unwarranted: HEAD in an empty
repository.

This squelches the warning for this special case.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 aff4e8dc
......@@ -278,7 +278,8 @@ int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref)
*ref = xstrdup(r);
if (!warn_ambiguous_refs)
break;
} else if (flag & REF_ISSYMREF)
} else if ((flag & REF_ISSYMREF) &&
(len != 4 || strcmp(str, "HEAD")))
warning("ignoring dangling symref %s.", fullref);
}
free(last_branch);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册