Only chmod if the user has supplied a mode

Otherwise existing permissions in the repo are overwritten. 

See http://tickets.opscode.com/browse/COOK-2033