Fixed commit diff logic