Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

repo.is_dirty() is not working with a pathspec #1061

Closed
@apatard

Description

Using a pathspec like ':!foo' as argument to repo.is_dirty() will result in :

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
 cmdline: git diff --cached --abbrev=40 --full-index --raw :!foo
 stderr: 'fatal: ambiguous argument '!foo': unknown revision or path not in the working tree.

The code should be adding a -- before the path to avoid any ambiguity. For instance, like that:

 if path:
 default_args.append('--')
 default_args.append(path)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /