public GitCheckoutResponse checkout ( File repositoryPath , Ref ref , List < File > paths ) throws JavaGitException , IOException { CheckUtilities . checkFileValidity ( repositoryPath ) ; if ( ref != null && ( ref . getRefType ( ) != RefType . BRANCH && ref . getRefType ( ) != RefType . SHA1 ) ) { throw new JavaGitException ( 100000 , ExceptionMessageMap . getMessage ( "100000" ) + " RefType passed: " + ref . getRefType ( ) ) ; } CheckUtilities . checkNullListArgument ( paths , "List of files" ) ; IClient client = ClientManager . getInstance ( ) . getPreferredClient ( ) ; IGitCheckout gitCheckout = client . getGitCheckoutInstance ( ) ; return gitCheckout . checkout ( repositoryPath , ref , paths ) ; }
Checks out files from the repository when a tree - ish object is given as the reference .