Skip to content

Shell error trying to diff non-existent file #206

@meangrape

Description

@meangrape

When opening a magit buffer, I get an error. The command it's trying to run is git diff --no-ext-diff --no-prefix --no-color -p -U3 -- "htop/htoprc". I have no htoprc file in this directory (though I did once use magit on an htoprc file a year or so ago in another repo). I just checked and there is, in fact, no file or directory named htop* in my home directory.

[jayed@cabernet ]  spiller  jayed/fix-logging (6946c) ❯ git ls-files | rg htop | wc -l                                             
       0
Shell command error
Cmd: ['git diff --no-ext-diff  --no-prefix --no-color -p -U3 --  "htop/htoprc"']
Error msg: ['error: open("htop/htoprc"): Permission denied', 'fatal: cannot hash htop/htoprc']
Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:48: function magit#show_magit[172]..magit#update_buffer[62].
.magit#state#update[24]..magit#state#add_file[50]..magit#git#git_diff, line 12: diff error
stack traceback:
        [C]: in function 'cmd'
        .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:48: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
Press ENTER or type command to continue

Results from git status

On branch jayed/fix-logging
Your branch is ahead of 'origin/jayed/fix-logging' by 4 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   spiller/__init__.py
        modified:   spiller/generators/geo.py
        modified:   spiller/hdf5/writer.py
        modified:   spiller/lib/SharedMem.pyx
        modified:   spiller/lib/_logger.hpp
        modified:   spiller/lib/_logger.pxd
        modified:   spiller/lib/_logger.pyx
        modified:   spiller/lib/cbor.pxd
        modified:   spiller/lib/cbor.pyx
        modified:   spiller/lib/events.pxd
        modified:   spiller/lib/events.pyx
        modified:   spiller/lib/exporters.pxd
        modified:   spiller/lib/exporters.pyx
        modified:   spiller/lib/writers.pyx
        modified:   spiller/perf.py
        modified:   spiller/spiller.py
        deleted:    test_logger.py
        renamed:    tests/test_logging.py -> tests/test_logger.py

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   Makefile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions