Skip to content

Commit 8bf9385

Browse files
committed
Fail correctly when amending an unborn commit
1 parent 97200a1 commit 8bf9385

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/git-strategies.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,13 @@ import * as reporterProxy from '../lib/reporter-proxy';
11981198
assert.strictEqual(amendedCommit.messageSubject, 'first');
11991199
assert.strictEqual(amendedCommit.messageBody, 'second\n\nthird');
12001200
});
1201+
1202+
it('attempts to amend an unborn commit', async function() {
1203+
const workingDirPath = await initRepository();
1204+
const git = createTestStrategy(workingDirPath);
1205+
1206+
await assert.isRejected(git.commit('', {amend: true, allowEmpty: true}), /You have nothing to amend/);
1207+
});
12011208
});
12021209
});
12031210

0 commit comments

Comments
 (0)