Page MenuHomePhabricator

Run ls-files from the root of the directory
ClosedPublic

Authored by ptarjan on Wed, Mar 25, 8:45 PM.

Details

Summary

One of our users ran into an issue where they were running arc diff in
a subdirectory and it so happened that in that directoy there wasn't any lfs
files so the repo was marked as $is_lfs == false. Lets allow arc to be run
from anywhere.

Test Plan

Internally this patch worked

Diff Detail

Repository
rARC Arcanist
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ptarjan created this revision.Wed, Mar 25, 8:45 PM
ptarjan requested review of this revision.Wed, Mar 25, 8:45 PM
epriestley requested changes to this revision.Wed, Mar 25, 8:49 PM

Try something like this:

list($stdout) = $repository_api->execxLocal(
  'ls-files ...',
  ':(attr...)');

That should set the CWD correctly and avoid a bunch of other issues (see T13479). We also likely can't $(...) on Windows.

This revision now requires changes to proceed.Wed, Mar 25, 8:49 PM

(Actual change makes perfect sense.)

If that doesn't immediately work, yell at me and I can grab this and figure out what's up.

ptarjan updated this revision to Diff 50136.Wed, Mar 25, 9:06 PM

use repository api

ptarjan edited the summary of this revision. (Show Details)Wed, Mar 25, 9:12 PM
ptarjan edited the summary of this revision. (Show Details)
ptarjan edited the summary of this revision. (Show Details)
epriestley accepted this revision.Wed, Mar 25, 9:13 PM

Thanks!

This revision is now accepted and ready to land.Wed, Mar 25, 9:13 PM
This revision was automatically updated to reflect the committed changes.