Skip to content

checkIsRepo does not work when GIT output is non english or german #766

@yeraydavidrodriguez

Description

@yeraydavidrodriguez

Currently, if the user has GIT configured to return its messages in other language than English or German, the method checkIsRepo does not work properly and returns a GIT command error.

This is caused by the way SimpleGit checks if a directory contains a GIT repository: On checkIsRepoTask method (check-is-repo.ts), it checks the result of the command git rev-parse --is-inside-work-tree. If it fails, but the error contains the expression "Not a git repository" or "Kein Git-Repository", the error is controlled and returns false. Else, it returns the error.

This last check is performed at check-is-repo.ts, line 68.

However, when GIT is configured to use other language, the error may be, i.e. ".git non è un repository Git (né lo è alcuna delle directory genitrici)" (Italian) or "fatal: no es un repositorio git (ni ninguno de los directorios superiores): .git" (Spanish), and therefore instead of false, the method will return the GIT error.

Another method, language-independent, should be used to guarantee the method executes reliably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    localemore-info-neededMore information is required in order to investigate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions