pub fn hook() -> Result<(), Error> {
        eprintln!("Running pre-receive hook...");

        let pre_receive = Self::from_stdin()?;

        // check if project exists.
        pre_receive.check_project_exists()?;

        // if allowed authorized keys is enabled, bypass the certificate check.
        if pre_receive.env.allow_unauthorized_keys.is_some() {
            println!("SECURITY ALERT! UNAUTHORIZED KEYS ARE ALLOWED!");
            println!("Remove git-server flag `--allow-authorized-keys` to enforce GPG certificate verification");

            Ok(())
        } else {
            // Authenticate the request.
            pre_receive.authenticate()
        }
    }
/// The main process used by `pre-receive` hook log
The main process used by `pre-receive` hook log
The main process used by ` pre - receive ` hook log
pub fn hook() -> Result<(), Error> {
        eprintln!("Running pre-receive hook...");
        let pre_receive = Self::from_stdin()?;
        // check if project exists.
        pre_receive.check_project_exists()?;
        // if allowed authorized keys is enabled, bypass the certificate check.
        if pre_receive.env.allow_unauthorized_keys.is_some() {
            println!("SECURITY ALERT! UNAUTHORIZED KEYS ARE ALLOWED!");
            println!("Remove git-server flag `--allow-authorized-keys` to enforce GPG certificate verification");
            Ok(())
        } else {
            // Authenticate the request.
            pre_receive.authenticate()
        }
    }
pub fn hook ( ) -> Result < ( ) , Error > { eprintln ! ( " " ) ; let pre_receive = Self :: from_stdin ( ) ? ; // check if project exists. pre_receive . check_project_exists ( ) ? ; // if allowed authorized keys is enabled, bypass the certificate check. if pre_receive . env . allow_unauthorized_keys . is_some ( ) { println ! ( " " ) ; println ! ( " " ) ; Ok ( ( ) ) } else { // Authenticate the request. pre_receive . authenticate ( ) } }
The main process used by `pre-receive` hook log
The main process used by ` pre - receive ` hook log