VS 扩展:Git 分支更改事件?

发布于 2025-01-10 07:48:09 字数 58 浏览 2 评论 0原文

当当前分支更改时,是否有可用于扩展的事件触发?每当发生这种情况时,我都需要从 GitHub 检索数据。

Is there an event available to extensions that fires when the current branch changes? I need to retrieve data from GitHub any time this happens.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蘑菇王子 2025-01-17 07:48:09

已解决:我在 %projectroot%.git\HEAD 上设置了一个 FileSystemWatcher 来处理 Created 事件,因为 Git 会在分支更改时删除并重新创建。热门提示:在使用路径参数实例化对象后设置 EnableRaisingEvents。否则你会得到一个 InvalidOperationException。

Solved: I set up a FileSystemWatcher on %projectroot%.git\HEAD that handles the Created event, since Git deletes and recreates on branch change. Hot tip: set EnableRaisingEvents AFTER the object is instantiated with the path parameter. Otherwise you'll get an InvalidOperationException.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文