Skip to content

Error during analysis - Unknown revision or path not in the working tree #478

@santhosh-fit

Description

@santhosh-fit

I have setup rubycritic for my project with base branch in rubycritic.yml for comparison. On CI for the feature branches, I have setup rubycritic analysis to be run for all the modified files only(instead of running on all files in app or lib folders), which runs the analysis for the identified files on main branch, the feature branch and produces the report with comparison (main vs feature branch). However, if there was a new file added as part of feature branch, the analysis produces an error while running on main branch as:

running churn
fatal: ambiguous argument 'app/models/<file>.rb': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

I understand that the new file is not part of main branch and hence this error. The analysis continues to run on feature branch and also produces a report.

Is there a way to skip running compare/analysis on main for the new files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions