Skip to content

Commit

Permalink
Two init commit nodes are created when starting a new feature.
Browse files Browse the repository at this point in the history
Unit tested.
closes #49
  • Loading branch information
geoffroy-aubry committed Apr 20, 2012
1 parent 30ce08a commit dfcf46d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion inc/twgit_feature.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ function cmd_start () {
assert_tag_exists
local last_tag=$(get_last_tag)
exec_git_command "git checkout -b $feature_fullname tags/$last_tag" "Could not check out tag '$last_tag'!"
process_first_commit 'feature' "$feature_fullname"

local subject="$(getFeatureSubject "$feature")"
[ ! -z "$subject" ] && subject=": $subject"
Expand Down
6 changes: 5 additions & 1 deletion tests/TwgitFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public function testStart_WithNoConnectorSetted ()
$this->_localShellCodeCall('function getFeatureSubject(){ echo;}; . \$TWGIT_INC_DIR/twgit_feature.inc.sh; cmd_start 1');
$sMsg = $this->_localExec('git show HEAD --format="%s"');
$this->assertEquals("[twgit] Init feature 'feature-1'.", $sMsg);
$sMsg = $this->_localExec('git show HEAD~1 --format="%s"');
$this->assertEquals("[twgit] Init branch 'stable'.", $sMsg);
}

/**
Expand All @@ -91,7 +93,9 @@ public function testStart_WithConnectorSetted ()

$this->_localShellCodeCall('function getFeatureSubject(){ echo \"Bla\'\\\\\"bla\";}; . \$TWGIT_INC_DIR/twgit_feature.inc.sh; cmd_start 1');
$sMsg = $this->_localExec('git show HEAD --format="%s"');
$this->assertEquals("[twgit] Init feature 'feature-1': Bla'\"bla.", $sMsg);
$this->assertEquals("[twgit] Init feature 'feature-1': Bla'\"bla.", $sMsg);
$sMsg = $this->_localExec('git show HEAD~1 --format="%s"');
$this->assertEquals("[twgit] Init branch 'stable'.", $sMsg);
}

}

0 comments on commit dfcf46d

Please sign in to comment.