dart-lang/spark — pull request #585 by camfitz (2014-01-06 06:53:33+00:00)
Title: Fixed commit functionality.

Commit command is issues are repaired.

- Changed some functions to use Completers rather than chaining together returns.
- Added error throwing with basic errors for testing.

Note:
running
```
Completer completer = new Completer
...
[synchronous code]
completer.complete()
[synchronous code]
...
return completer.future;
```
unfortunately does not work - the completer.future must be return before the completer is completed! (i.e. the code with the completer.complete() must be run async.
Instances of this are fixed by replacing the synchronous block with an embedded function, and
```
return new Future.sync(() => findPack());
```
enabling the future return format.

Also fixed a problem in retrieveObject - the result from the reader may be an ArrayBuffer or a ByteBuffer. Fix copied from a similar use-case elsewhere in the Git codebase.

_storeInFile is fixed to note that ChrFileEntry.fileWriter is not yet implemented. writeBytes works as a substitute until fileWrite is implemented.

getConfig() is fixed to handle the case (which occurs every initial commit) where the GitConfig string is null. This needs to be enhanced in the future.