@@ -1985,6 +1985,14 @@ private RepositoryModel loadRepositoryModel(String repositoryName) {
19851985 boolean hasOrigin = !StringUtils .isEmpty (config .getString ("remote" , "origin" , "url" ));
19861986
19871987 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+ }
19881996 model .description = getConfig (config , "description" , "" );
19891997 model .originRepository = getConfig (config , "originRepository" , null );
19901998 model .addOwners (ArrayUtils .fromString (getConfig (config , "owner" , "" )));
@@ -2497,6 +2505,15 @@ public void updateRepositoryModel(String repositoryName, RepositoryModel reposit
24972505 // update settings
24982506 if (r != null ) {
24992507 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+ }
25002517 // only update symbolic head if it changes
25012518 String currentRef = JGitUtils .getHEADRef (r );
25022519 if (!StringUtils .isEmpty (repository .HEAD ) && !repository .HEAD .equals (currentRef )) {
0 commit comments