question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Delete file not listed

See original GitHub issue

What do I get:

await git.listFiles({fs, dir});
// ['foo', 'bar', 'baz'];
await git.remove({fs, dir, 'foo'});
await git.listFiles({fs, dir});
// ['bar', 'baz'];
// should be [['foo', 'bar', 'baz'];
await pfs.readDir(dir);
// ['foo', 'bar', 'baz']
await git.status({fs, dir: '/test', filepath: 'foo'})
// undocumented "*undeleted"
await git.add({fs, dir: '/test', filepath: 'foo'})
await git.status({fs, dir: '/test', filepath: 'foo'})
// "unmodified"

await git.remove({fs, dir, 'foo'});
await pfs.unlink('/test/foo');
await git.status({fs, dir: '/test', filepath: 'foo'})
// deleted which is fine but
await git.listFiles({fs, dir});
// ['bar', 'baz'];
// should be [['foo', 'bar', 'baz'];

What I expect:

the file should always be on the list because it’s not yet committed. When I call fs.unlink('/test/foo'); the file have correct status deleted but it’s not one the list.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
wmhiltoncommented, May 18, 2018

Yeah… so readObject is still better for say a file explorer UI or searching for a particular file, but for the simple case of “just list all the files in the commit” it would make sense to have it built in, because listing all the files is going to be maximally inefficient regardless, but still needed for a lot of common tasks - like git merge most likely.

1reaction
jcubiccommented, May 17, 2018

I think that there is no problem in doing extra step to delete the file but there should be example how to list all the files in FAQ or maybe update the api with extra parameter that will indicate that it should show files from commit/HEAD.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't delete file, 'could not find this file' please help
1. Close any open programs and try deleting the file again. · 2. Press the Windows key + R and type cmd to...
Read more >
Fix “Could Not Find This Item” When Deleting in Windows
Use Command Prompt To Fix “Could Not Find This Item” · Rename The File Using Command Prompt Before Deleting It · Delete Files...
Read more >
How to Fix the "Item Not Found" Windows Error When Deleting ...
First way: Right click on the folder/file, and click properties. Screenshot-2022-04-14-231044. Here, you will get the directory address.
Read more >
[Fix] “Could not find this item” When Deleting a File or Folder ...
Method 1: Delete the file or folder from Command Prompt · Press and hold the Shift key and right click on the file...
Read more >
6 Ways to Fix the “Could Not Find This Item” Deletion Error in ...
1. Restart Windows Explorer · 2. Zip Up the Item and Then Delete the Zipped File · 3. Delete the File Using PowerShell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found