zaggino/brackets-git — pull request #858 by albertinad (2014-12-17 02:29:23+00:00)
Title: Change extension initialization to always make sure that git path is configured.

Hi @zaggino , this is a proposed solution for the issue #857.
When loading the extension as if it is a clean installation, by clean I mean the first time the user installs the extension or there isn't any information stored in brackets preferences related to the extension, it fails with an Exception.
This is due to a check that performs the main.js module (in the current master branch code) to display the Settings or Change log dialog,

`if (!lastVersion) {
Preferences.persist("lastVersion", "firstStart");
SettingsDialog.show();
} `

When the if clause is true, the call to `SettingsDialog.show()` performs a call to `Git.js` module API to execute the `git config` to get the default diff tool configured on the system. This is done before setting the git path to the extension so ends in an uncaught exception.

In the following pull request a I made a few changes to the initialization process to make sure that the calls are made after the git path is configured. I checked this changes in brackets and Intel XDK, in which this bug causes a crash for us. I tried the features of the extensions and everything seems to work ok.

If you have any suggestion on the changes proposed please let me know.
Thanks!