Fix behavior with non-commit upstream references