Make inreplace conditional on --HEAD