I would chomp so you don't ahve to do it multiple times:

local_sha.chomp!
remote_sha.chomp!