@@ -1985,6 +1985,14 @@ private RepositoryModel loadRepositoryModel(String repositoryName) {
1985
1985
boolean hasOrigin = !StringUtils .isEmpty (config .getString ("remote" , "origin" , "url" ));
1986
1986
1987
1987
if (config != null ) {
1988
+ // Initialize description from description file
1989
+ if (getConfig (config ,"description" , null ) == null ) {
1990
+ File descFile = new File (r .getDirectory (), "description" );
1991
+ if (descFile .exists ()) {
1992
+ config .setString (Constants .CONFIG_GITBLIT , null , "description" ,
1993
+ com .gitblit .utils .FileUtils .readContent (descFile , System .getProperty ("line.separator" )));
1994
+ }
1995
+ }
1988
1996
model .description = getConfig (config , "description" , "" );
1989
1997
model .originRepository = getConfig (config , "originRepository" , null );
1990
1998
model .addOwners (ArrayUtils .fromString (getConfig (config , "owner" , "" )));
@@ -2497,6 +2505,15 @@ public void updateRepositoryModel(String repositoryName, RepositoryModel reposit
2497
2505
// update settings
2498
2506
if (r != null ) {
2499
2507
updateConfiguration (r , repository );
2508
+ // Update the description file
2509
+ File descFile = new File (r .getDirectory (), "description" );
2510
+ if (repository .description != null )
2511
+ {
2512
+ com .gitblit .utils .FileUtils .writeContent (descFile , repository .description );
2513
+ }
2514
+ else if (descFile .exists () && !descFile .isDirectory ()) {
2515
+ descFile .delete ();
2516
+ }
2500
2517
// only update symbolic head if it changes
2501
2518
String currentRef = JGitUtils .getHEADRef (r );
2502
2519
if (!StringUtils .isEmpty (repository .HEAD ) && !repository .HEAD .equals (currentRef )) {
0 commit comments