Skip to content

Commit

Permalink
Fix invalid translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Gaillard committed Jun 2, 2015
1 parent f793e76 commit 373529e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Basic operations

``` php
<?php
$repo->isChanges(); // returns boolean
$repo->hasChanges(); // returns boolean
$repo->commit('commit message');
$repo->merge('branch-name');
$repo->checkout('master');
Expand Down
2 changes: 1 addition & 1 deletion src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function commit($message, $params = NULL)
* `git status` + magic
* @return bool
*/
public function isChanges()
public function hasChanges()
{
$this->begin();
$lastLine = exec('git status');
Expand Down
2 changes: 1 addition & 1 deletion src/IGit.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function commit($message, $params = NULL);
* Exists changes?
* @return bool
*/
function isChanges();
function hasChanges();



Expand Down
26 changes: 13 additions & 13 deletions tests/GitPhp/basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Assert::exception(function() use ($repo) {
$repo->getCurrentBranchName();
}, 'Cz\Git\GitException', 'Getting current branch name failed.');

Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
Assert::null($repo->getTags());
Assert::null($repo->getBranches());

// init commit
$file = TEMP_DIR . '/first.txt';
file_put_contents($file, "Lorem\n\tipsum\ndolor sit\namet.\n");
$repo->addFile($file);
Assert::true($repo->isChanges());
Assert::true($repo->hasChanges());
$repo->commit('First commit');

Assert::same('master', $repo->getCurrentBranchName());
Expand All @@ -42,16 +42,16 @@ file_put_contents($file, "Sit amet dolor ipsum lorem.\n");
$repo->addFile(array(
$file,
));
Assert::true($repo->isChanges());
Assert::true($repo->hasChanges());
$repo->commit('Second commit');
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());


// remove second file
$repo->removeFile($file);
Assert::true($repo->isChanges());
Assert::true($repo->hasChanges());
$repo->commit('Removed second file');
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());


// Branches
Expand All @@ -67,12 +67,12 @@ $file = TEMP_DIR . '/first.txt';
$content = file_get_contents($file);
$newContent = "$content\n\tchanged " . date('Y-m-d H:i:s');

Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
file_put_contents($file, $newContent);
Assert::true($repo->isChanges());
Assert::true($repo->hasChanges());
$repo->addFile($file);
$repo->commit('Changed first file.');
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());

$repo->checkout('master');
Assert::same('master', $repo->getCurrentBranchName());
Expand All @@ -81,9 +81,9 @@ $repo->createTag('v0.9.0');
Assert::same(array(
'v0.9.0',
), $repo->getTags());
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
$repo->merge('develop');
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());

Assert::same($newContent, file_get_contents($file));

Expand All @@ -106,9 +106,9 @@ $repo->checkout('v1.0.0');
Assert::same($content, file_get_contents($file));

$repo->checkout('v2.0.0');
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
$repo->renameFile($file, $newFile = TEMP_DIR . '/renamed.txt');
Assert::true($repo->isChanges());
Assert::true($repo->hasChanges());
$repo->commit('First file renamed.');
Assert::false(is_file($file));
Assert::true(is_file($newFile));
Expand Down
4 changes: 2 additions & 2 deletions tests/GitPhp/clone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ chdir($cwd);
Assert::same(realpath(TEMP_DIR . '/git-php'), $repo->getRepositoryPath());

// repo is empty
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
$tags = $repo->getTags();
Assert::true(in_array('v1.0.0', $tags));
Assert::true(in_array('v1.0.1', $tags));
Expand All @@ -43,7 +43,7 @@ $repo = GitRepository::cloneRepository('https://github.com/czproject/git-php.git
Assert::same(realpath(TEMP_DIR . '/git-php2'), $repo->getRepositoryPath());

// repo is empty
Assert::false($repo->isChanges());
Assert::false($repo->hasChanges());
$tags = $repo->getTags();
Assert::true(in_array('v1.0.0', $tags));
Assert::true(in_array('v1.0.1', $tags));
Expand Down

0 comments on commit 373529e

Please sign in to comment.