mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-02 18:54:27 +02:00
Implement rev-list
This commit introduces the RevisionRange, which more closely follows real git in terms of identifying a range of revisions than the current implementation of log. RevisionRange is being used in the new rev-list command first because it is easy to test for ordering. A future commit will replace the existing implementation of log with RevisionRange.
This commit is contained in:
parent
6e5d6a64e9
commit
8529a3aac7
3 changed files with 128 additions and 0 deletions
|
@ -276,6 +276,43 @@ describe('Git', function() {
|
|||
);
|
||||
});
|
||||
|
||||
describe('RevList', function() {
|
||||
|
||||
it('requires at least 1 argument', function() {
|
||||
runCommand('git rev-list', function(commandMsg) {
|
||||
expect(commandMsg).toContain('at least 1');
|
||||
});
|
||||
});
|
||||
|
||||
describe('supports', function() {
|
||||
var SETUP = 'git co -b left C0; gc; git merge master; git co -b right C0; gc; git merge master; git co -b all left; git merge right; ';
|
||||
|
||||
it('single included revision', function() {
|
||||
runCommand(SETUP + 'git rev-list all', function(commandMsg) {
|
||||
expect(commandMsg).toBe('C6\nC5\nC4\nC3\nC2\nC1\nC0\n');
|
||||
});
|
||||
});
|
||||
|
||||
it('single excluded revision', function() {
|
||||
runCommand(SETUP + 'git rev-list all ^right', function(commandMsg) {
|
||||
expect(commandMsg).toBe('C6\nC3\nC2\n');
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple included revisions', function() {
|
||||
runCommand(SETUP + 'git rev-list right left', function(commandMsg) {
|
||||
expect(commandMsg).toBe('C5\nC4\nC3\nC2\nC1\nC0\n');
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple excluded revisions', function() {
|
||||
runCommand(SETUP + 'git rev-list all ^right ^left', function(commandMsg) {
|
||||
expect(commandMsg).toBe('C6\n');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Log supports', function() {
|
||||
var SETUP = 'git co -b left C0; gc; git merge master; git co -b right C0; gc; git merge master; git co -b all left; git merge right; ';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue