Repository: steveukx/git-js (ts)

Issue:
"git.log" leads (since simple-git 2.25.0) to a complete crash of the program
Since version 2.25.0 my program crashes when calling git.log without making an exception.

I wrote a mocha unit test to reproduce the bug.
The unit test passes with version 2.24.0, but crashes with version 2.25.0 without error.

```typescript
import { emptyDir, ensureDir, rmdir, writeFile } from 'fs-extra';
import { join } from 'path';
import createRepository from 'simple-git/promise';

describe('Test the git.log functionality', function () {
  it('return the parsed log entries', async function () {
    this.timeout(0);
    const testRepoPath = join(__dirname, 'test_repo_test');
    try {
      await ensureDir(testRepoPath);
      const repo = createRepository(testRepoPath);
      await repo.init();

      const commit1Path = join(testRepoPath, 'commit1');
      await writeFile(commit1Path, 'commit1');
      await repo.add(commit1Path);
      await repo.commit('Commit 1', commit1Path);
      await repo.tag(['1.0.0']);

      const commit2Path = join(testRepoPath, 'commit2');
      await writeFile(commit2Path, 'commit2');
      await repo.add(commit2Path);
      await repo.commit('Commit 2', commit2Path);

      const logs = await repo.log({
        from: 'HEAD',
        to: '1.0.0',
        symmetric: true,
      });

      console.log(logs.all);
    } finally {
      await emptyDir(testRepoPath);
      await rmdir(testRepoPath);
    }
  });
});
```

About help I would be very grateful.

Pull request description:
Bug fix for git.log
Resolves an issue whereby using `git.log` with a callback (or awaiting the promise created from the now deprecated `simple-git/promise` import) would fail to return the response to the caller.

Closes #536

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13eb2f1..9f12ebd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
 
 # Change History & Release Notes
 
+## 2.26.0 Fix error when using `git.log` with callback
+
+- Resolves an issue whereby using `git.log` with a callback (or awaiting the promise created from the now deprecated
+  `simple-git/promise` import) would fail to return the response to the caller. 
+
 ## 2.25.0 TypeScript Types & Unit Tests, Commit Parsing
 
 - To help keep the TypeScript definitions in line with functionality, unit tests are now written in TypeScript.
diff --git a/src/git.js b/src/git.js
index 404a6ed..28dc882 100644
--- a/src/git.js
+++ b/src/git.js
@@ -874,7 +874,8 @@ Git.prototype.log = function (options) {
    );
 
    return this._runTask(
-      logTask(parsedOptions.splitter, parsedOptions.fields, parsedOptions.commands)
+      logTask(parsedOptions.splitter, parsedOptions.fields, parsedOptions.commands),
+      next,
    )
 };
 


Test patch:
diff --git a/test/unit/log.spec.ts b/test/unit/log.spec.ts
index e07c6a5..9baf5bf 100644
--- a/test/unit/log.spec.ts
+++ b/test/unit/log.spec.ts
@@ -491,7 +491,14 @@ ${START_BOUNDARY}207601debebc170830f2921acf2b6b27034c3b1f::2016-01-03 15:50:58 +
       }
    });
 
-   describe('usage:await', () => {
+   describe('usage:', () => {
+
+      it('passes result to callback', async () => {
+         const then = jest.fn();
+         const task = git.log(['--some-option'], then);
+         await closeWithSuccess();
+         expect(then).toHaveBeenCalledWith(null, await task);
+      });
 
       it('when awaiting array option', async () => {
          git.log(['--all']);