Buggy code:
private final ObjectCache < List < Metric > > repositoryMetricsCache = new ObjectCache < List < Metric > > ( ) ; private RepositoryResolver < Void > repositoryResolver ; private ServletContext servletContext ; private File repositoriesFolder ; private IUserService userService ; private IStoredSettings settings ; private ServerSettings settingsModel ; private ServerStatus serverStatus ; private MailExecutor mailExecutor ; private TimeZone timezone ; public GitBlit ( ) { } public static GitBlit self ( ) { } public static boolean isGO ( ) { } public static TimeZone getTimezone ( ) { } public static boolean getBoolean ( String key , boolean defaultValue ) { } public static int getInteger ( String key , int defaultValue ) { } public static char getChar ( String key , char defaultValue ) { } public static String getString ( String key , String defaultValue ) { } public static List < String > getStrings ( String key ) { } public static List < String > getAllKeys ( String startingWith ) { } public static boolean isDebugMode ( ) { } public static File getFileOrFolder ( String key , String defaultFileOrFolder ) { } public static File getFileOrFolder ( String fileOrFolder ) { } public static File getRepositoriesFolder ( ) { } public static File getProposalsFolder ( ) { } public static File getGroovyScriptsFolder ( ) { } public boolean updateSettings ( Map < String , String > updatedSettings ) { } public ServerStatus getStatus ( ) { } public List < String > getOtherCloneUrls ( String repositoryName ) { } public void setUserService ( IUserService userService ) { } public UserModel authenticate ( String username , char [ ] password ) { } public UserModel authenticate ( Cookie [ ] cookies ) { } public void setCookie ( WebResponse response , UserModel user ) { } public List < String > getAllUsernames ( ) { } public List < UserModel > getAllUsers ( ) { } public boolean deleteUser ( String username ) { } public UserModel getUserModel ( String username ) { } public List < String > getRepositoryUsers ( RepositoryModel repository ) { } public boolean setRepositoryUsers ( RepositoryModel repository , List < String > repositoryUsers ) { } public void updateUserModel ( String username , UserModel user , boolean isCreate ) throws GitBlitException { } public List < String > getAllTeamnames ( ) { } public List < TeamModel > getAllTeams ( ) { } public TeamModel getTeamModel ( String teamname ) { } public List < String > getRepositoryTeams ( RepositoryModel repository ) { } public boolean setRepositoryTeams ( RepositoryModel repository , List < String > repositoryTeams ) { } public void updateTeamModel ( String teamname , TeamModel team , boolean isCreate ) throws GitBlitException { } public boolean deleteTeam ( String teamname ) { } public void clearRepositoryCache ( String repositoryName ) { } public List < String > getRepositoryList ( ) { } public Repository getRepository ( String repositoryName ) { } public Repository getRepository ( String repositoryName , boolean logError ) { } public List < RepositoryModel > getRepositoryModels ( UserModel user ) { } public RepositoryModel getRepositoryModel ( UserModel user , String repositoryName ) { } public RepositoryModel getRepositoryModel ( String repositoryName ) { Repository r = getRepository ( repositoryName ) ; if ( r == null ) { return null ; } RepositoryModel model = new RepositoryModel ( ) ; model . name = repositoryName ; model . hasCommits = JGitUtils . hasCommits ( r ) ; <START_BUG> model . lastChange = JGitUtils . getLastChange ( r , null ) ; <END_BUG> model . isBare = r . isBare ( ) ; StoredConfig config = JGitUtils . readConfig ( r ) ; if ( config != null ) { model . description = getConfig ( config , "description" , "" ) ; model . owner = getConfig ( config , "owner" , "" ) ; model . useTickets = getConfig ( config , "useTickets" , false ) ; model . useDocs = getConfig ( config , "useDocs" , false ) ; model . accessRestriction = AccessRestrictionType . fromName ( getConfig ( config , "accessRestriction" , null ) ) ; model . showRemoteBranches = getConfig ( config , "showRemoteBranches" , false ) ; model . isFrozen = getConfig ( config , "isFrozen" , false ) ; model . showReadme = getConfig ( config , "showReadme" , false ) ; model . skipSizeCalculation = getConfig ( config , "skipSizeCalculation" , false ) ; model . skipSummaryMetrics = getConfig ( config , "skipSummaryMetrics" , false ) ; model . federationStrategy = FederationStrategy . fromName ( getConfig ( config , "federationStrategy" , null ) ) ; model . federationSets = new ArrayList < String > ( Arrays . asList ( config . getStringList ( "gitblit" , null , "federationSets" ) ) ) ; model . isFederated = getConfig ( config , "isFederated" , false ) ; model . origin = config . getString ( "remote" , "origin" , "url" ) ; model . preReceiveScripts = new ArrayList < String > ( Arrays . asList ( config . getStringList ( "gitblit" , null , "preReceiveScript" ) ) ) ; model . postReceiveScripts = new ArrayList < String > ( Arrays . asList ( config . getStringList ( "gitblit" , null , "postReceiveScript" ) ) ) ; model . mailingLists = new ArrayList < String > ( Arrays . asList ( config . getStringList ( "gitblit" , null , "mailingList" ) ) ) ; } model . HEAD = JGitUtils . getHEADRef ( r ) ; model . availableRefs = JGitUtils . getAvailableHeadTargets ( r ) ; r . close ( ) ; return model ; } public long calculateSize ( RepositoryModel model ) { } private void closeRepository ( String repositoryName ) { } public List < Metric > getRepositoryDefaultMetrics ( RepositoryModel model , Repository repository ) { } private String getConfig ( StoredConfig config , String field , String defaultValue ) { }

Fix:
model . lastChange = JGitUtils . getLastChange ( r ) ;