Fix a bug caused by integrating the substate update into safe_commit_and_push.

$1 needed to become $dir.

Auditors: chris

Test plan:
Fingers crossed