Update June 18, 2009: The MX public repository has been moved to http://github.com/metamolecular/mx.
A specific example from MX, the lightweight cheminformatics toolkit, illustrates the process. It was found that MX was throwing an exception where none should be thrown. A new issue was created describing the observed behavior in terms of a failing test. After diagnosing and eliminating the problem, the issue was closed by adding 'Closes #2' to the git commit message. And voila - the issue was closed with a link to the commit that closed it and a link to the original issue in the commit page.