File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,20 @@ public function getHooks()
338
338
return new Hooks ($ this );
339
339
}
340
340
341
+ /**
342
+ * Return the description
343
+ *
344
+ * @return string The description
345
+ */
346
+ public function getDescription ()
347
+ {
348
+ if (!is_file ($ this ->gitDir .'/description ' )) {
349
+ return 'Unnamed repository; edit this file \'description \' to name the repository. ' ;
350
+ }
351
+
352
+ return file_get_contents ($ this ->gitDir .'/description ' );
353
+ }
354
+
341
355
/**
342
356
* This command is a facility command. You can run any command
343
357
* directly on git repository.
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ public function testIsBare()
46
46
$ this ->assertFalse ($ notBare ->isBare (), "Working copy is not bare " );
47
47
}
48
48
49
+ /**
50
+ * @dataProvider provideFoobar
51
+ */
52
+ public function testGetDescription ($ repository )
53
+ {
54
+ $ this ->assertSame ("Unnamed repository; edit this file 'description' to name the repository. \n" , $ repository ->getDescription ());
55
+ }
56
+
49
57
/**
50
58
* @dataProvider provideFoobar
51
59
*/
You can’t perform that action at this time.
0 commit comments