ChainSecurity/deployment_validation

Cannot fetch-from-etherscan inside git repository

Closed this issue · 0 comments

Steps

Try to fetch from etherscan with --project set to a path that is already in a git repository.

Output

The tool fails when trying to unwrap the foundry toml file. At fetch.rs line 280. For some reason, the error produced by forge init is not caught.

Running forge init manually yields the real error:

The target directory is a part of or on its own an already initialized git repository,
and it requires clean working and staging areas, including no untracked files.

Check the current git repository's status with `git status`.
Then, you can track files with `git add ...` and then commit them with `git commit`,
ignore them in the `.gitignore` file, or run this command again with the `--no-commit` flag.

If none of the previous steps worked, please open an issue at:
https://github.com/foundry-rs/foundry/issues/new/choose

Possible fix

Add --no-commit to the forge init command