我似乎无法弄清楚如何获得git_reference *
特定遥控器的 HEAD。
我有:
git_repository * repo = NULL;
git_reference * ref = NULL;
/* ...load repository... */
if(git_reference_lookup(&ref, repo, "remotes/origin/HEAD"))
printf("Error obtaining reference to remote HEAD!");
运行应用程序时会显示错误消息,指示未找到引用。但是,远程 HEAD 确实存在:
$: 查找 .git/refs/* .git/refs/heads .git/refs/heads/master .git/refs/remotes .git/refs/remotes/origin .git/refs/remotes/origin/HEAD .git/refs/tags
为什么我无法获得git_reference *
远程 HEAD?