'VS Extension: Git branch change event?

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.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Easy Rhino