VS 扩展:Git 分支更改事件?
当当前分支更改时,是否有可用于扩展的事件触发?每当发生这种情况时,我都需要从 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决:我在 %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.