public static Iterable < PushResult > push ( Git git , String remote , String branch , GitAuthenticationConfigurator authConfigurator ) throws GitAPIException { PushCommand push = git . push ( ) ; push . setRemote ( remote ) ; if ( StringUtils . isNotEmpty ( branch ) ) { push . setRefSpecs ( new RefSpec ( Constants . HEAD + ":" + Constants . R_HEADS + branch ) ) ; } if ( authConfigurator != null ) { authConfigurator . configureAuthentication ( push ) ; } return push . call ( ) ; }
Executes a git push .