Skip to content

Commit

Permalink
fix, delete index.json on the remote if it is outdated (#9242)
Browse files Browse the repository at this point in the history
This PR reverts #1624.
In case the remote encounters an outdated index.json it wasn't throw an
error about it. The problem is that some functions calling it expect to
get objects. (e.g. `loadLane`). This PR, removes the check whether it's
a remote, and whenever an index.json file is outdated, it deletes it and
throw an error telling the user to re-run the command.
  • Loading branch information
davidfirst authored Oct 14, 2024
1 parent 67bb272 commit 8ef0c06
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/scope/objects/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,6 @@ export default class Repository {
const bitObject = await this.load(new Ref(hash));
if (!bitObject) {
const indexJsonPath = this.scopeIndex.getPath();
if (this.scopeIndex.isFileOnBitHub()) {
logger.error(
`repository._getBitObjectsByHashes, indexJson at "${indexJsonPath}" is outdated and needs to be deleted`
);
return null;
}
const indexItem = this.scopeIndex.find(hash);
if (!indexItem) throw new Error(`_getBitObjectsByHashes failed finding ${hash}`);
await this.scopeIndex.deleteFile();
Expand Down

0 comments on commit 8ef0c06

Please sign in to comment.