Skip to content

Commit d0a21e9

Browse files
committed
Added support for Repository::hasDescription
1 parent ed04c88 commit d0a21e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Gitonomy/Git/Repository.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*/
2929
class Repository
3030
{
31+
const DEFAULT_DESCRIPTION = "Unnamed repository; edit this file 'description' to name the repository.\n";
3132
/**
3233
* @var string
3334
*/
@@ -346,12 +347,17 @@ public function getHooks()
346347
public function getDescription()
347348
{
348349
if (!is_file($this->gitDir.'/description')) {
349-
return 'Unnamed repository; edit this file \'description\' to name the repository.';
350+
return static::DEFAULT_DESCRIPTION;
350351
}
351352

352353
return file_get_contents($this->gitDir.'/description');
353354
}
354355

356+
public function hasDescription()
357+
{
358+
return static::DEFAULT_DESCRIPTION !== $this->getDescription();
359+
}
360+
355361
/**
356362
* This command is a facility command. You can run any command
357363
* directly on git repository.

0 commit comments

Comments
 (0)