Page MenuHomePhabricator

`git push` fatals when CWD does not exist
Closed, ResolvedPublic

Description

See PHI1384. To reproduce this:

repository/ $ mkdir xyz
repository/ $ cd xyz
repository/xyz/ $

In a second window:

repository/ $ rm -rf xyz

In the first window:

repository/xyz/ $ git push
fatal: Unable to read current working directory: No such file or directory

In practice, this can arise naturally if:

  • the user is in a recently-created directory ("abc/") in their repository;
  • they run arc land X, where X is some other branch where "abc/" did not exist yet;
  • arc checks out the state in X and ultimately runs git push with a now-nonexistent CWD.

This can presumably be fixed by forcing git push to execute from the repository root.

We should possibly apply this to every git command since we might execute almost anything after a checkout causes a state-change and I can't come up with any problems this would cause offhand.