Merge branch 'sg/update-ref-stdin-cleanup'