Skip to content

Commit

Permalink
#125 Fix some tests/commands for OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
ltoussaint committed Sep 8, 2014
1 parent 3fa14a0 commit 6612e00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion inc/common.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ function update_version_information () {
for filepath in $(echo $TWGIT_VERSION_INFO_PATH | tr ',' ' '); do
if [[ -f $filepath ]]; then
CUI_displayMsg processing "Updating $Id$ tags in $filepath..."
sed -i 's/\$Id[:v0-9\.]*\$/$Id:'$version'$/g' "$filepath"
sed -i -e 's/\$Id[:v0-9\.]*\$/$Id:'$version'$/g' "$filepath"
exec_git_command "git add $filepath" "Could not add version info into $filepath!"
else
CUI_displayMsg warning "TWGIT_VERSION_INFO_PATH contains a non-existing file: $filepath!"
Expand Down
7 changes: 5 additions & 2 deletions inc/twgit_feature.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ function cmd_migrate () {
die "Remote feature '$feature_fullname' already exists!"
fi

echo -n $(CUI_displayMsg question "Are you sure to migrate '$oldfeature_fullname' to '$feature_fullname'? Branch '$oldfeature_fullname' will be deleted. [Y/N] "); read answer
[ "$answer" != "Y" ] && [ "$answer" != "y" ] && die 'Branch migration aborted!'

if ! isset_option 'I'; then
echo -n $(CUI_displayMsg question "Are you sure to migrate '$oldfeature_fullname' to '$feature_fullname'? Branch '$oldfeature_fullname' will be deleted. [Y/N] "); read answer
[ "$answer" != "Y" ] && [ "$answer" != "y" ] && die 'Branch migration aborted!'
fi

CUI_displayMsg processing "Migrate '<b>$oldfeature_fullname</b>' to '<b>$feature_fullname</b>'..."
exec_git_command "git checkout --track -b $feature_fullname $TWGIT_ORIGIN/$oldfeature_fullname" "Could not check out feature '$TWGIT_ORIGIN/$oldfeature_fullname'!"
Expand Down
2 changes: 1 addition & 1 deletion tests/TwgitFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function testMigrate_WithPrefixes ()
$this->_remoteExec('git init');
$this->_localExec(TWGIT_EXEC . ' init 1.2.3 ' . TWGIT_REPOSITORY_ORIGIN_DIR);
$this->_remoteExec('git checkout ' . self::STABLE . ' && git branch toto');
$sMsg = $this->_localExec('yes | ' . TWGIT_EXEC . ' feature migrate toto feature-42');
$sMsg = $this->_localExec(TWGIT_EXEC . ' feature migrate -I toto feature-42');
$this->assertContains("Assume feature was '42' instead of 'feature-42'", $sMsg);
}

Expand Down

0 comments on commit 6612e00

Please sign in to comment.