The Northern Ireland Under-21 cap started at centre-half in a three-man defence in the friendly at Windsor Park in Belfast on Monday.
The 19-year-old performed above his tender years in the fund-raising friendly and helped Ally McCoist's team keep a clean sheet in a 2-0 win.
The former Dungannon player is out of contract with the crisis-hit Glasgow giants at the end of the month and has not been offered an extension.
However, Hegarty is optimistic that he will be asked to stay at the Light Blues. He said: "I am just taking every day as it comes at the minute. But I need to sign a new contract as my current deal expires on the 31st of this month and I don't know what is happening with that.
"I don't have a clue what will happen. I haven't spoken to anyone about my future. Fingers crossed, the manager will come and speak to me. I definitely want to stay. I love the club and the fans. You can't beat it.
"Getting a clean sheet and helping the club win is obviously a positive thing for me. Hopefully, the manager will have gone away from the match thinking: 'The lad did well there'."
Hegarty added: "I haven't been looking anywhere else because I want to stay at Rangers. This is where I want to be. I think everyone at the club is the same to be honest.
"It is the biggest club in Scotland and a great place to learn your trade.
"I will probably just leave it for another week or so and then try to sort something out come the end of the month. I am keeping my fingers crossed and hopefully after the Linfield game the gaffer will be thinking positively."