From 373529e5f8284dfeb6ed94d022b0aef7effc3f7e Mon Sep 17 00:00:00 2001 From: Francois Gaillard Date: Tue, 2 Jun 2015 13:46:22 +0200 Subject: [PATCH] Fix invalid translation --- readme.md | 2 +- src/GitRepository.php | 2 +- src/IGit.php | 2 +- tests/GitPhp/basic.phpt | 26 +++++++++++++------------- tests/GitPhp/clone.phpt | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/readme.md b/readme.md index 256c627..3fdf8ed 100644 --- a/readme.md +++ b/readme.md @@ -62,7 +62,7 @@ Basic operations ``` php isChanges(); // returns boolean +$repo->hasChanges(); // returns boolean $repo->commit('commit message'); $repo->merge('branch-name'); $repo->checkout('master'); diff --git a/src/GitRepository.php b/src/GitRepository.php index de82d23..612d10a 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -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'); diff --git a/src/IGit.php b/src/IGit.php index 01d773c..e4e78ce 100644 --- a/src/IGit.php +++ b/src/IGit.php @@ -143,7 +143,7 @@ function commit($message, $params = NULL); * Exists changes? * @return bool */ - function isChanges(); + function hasChanges(); diff --git a/tests/GitPhp/basic.phpt b/tests/GitPhp/basic.phpt index 16af8e0..5707e21 100644 --- a/tests/GitPhp/basic.phpt +++ b/tests/GitPhp/basic.phpt @@ -19,7 +19,7 @@ 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()); @@ -27,7 +27,7 @@ Assert::null($repo->getBranches()); $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()); @@ -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 @@ -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()); @@ -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)); @@ -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)); diff --git a/tests/GitPhp/clone.phpt b/tests/GitPhp/clone.phpt index 4a160ab..941e8c4 100644 --- a/tests/GitPhp/clone.phpt +++ b/tests/GitPhp/clone.phpt @@ -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)); @@ -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));