Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws FileNotFoundError for bare repo #10

Open
sahinakkaya opened this issue Apr 17, 2022 · 0 comments
Open

Throws FileNotFoundError for bare repo #10

sahinakkaya opened this issue Apr 17, 2022 · 0 comments

Comments

@sahinakkaya
Copy link

sahinakkaya commented Apr 17, 2022

When I try to view diff for a bare repo, it throws FileNotFoundError.

To reproduce:

❯ cd
❯ git init --bare my_bare_repo
Initialized empty Git repository in /home/***/my_bare_repo/
❯ alias bare="/usr/bin/git --git-dir=$HOME/my_bare_repo --work-tree=$HOME"
❯ bare config --local status.showUntrackedFiles no
❯ mkdir -p ~/.config/test_dir
❯ touch ~/.config/test_dir/test_file
❯ bare add ~/.config/test_dir/test_file
❯ echo hello > ~/.config/test_dir/test_file
❯ bare diff | dunk
                                                             1 file added
                                                   +1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━ -0

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ Added .config/test_dir/test_file (1 additions, 0 removals) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲ @@ -0,0 +1,1 @@  ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
  1                                                                  1 hello
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
                                                                                                                    /// dunk 0.4.0a0
❯ cd .config
❯ bare diff | dunk
                                                             1 file added
                                                   +1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━ -0

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ Added .config/test_dir/test_file (1 additions, 0 removals) ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
Traceback (most recent call last):
  File "/home/***/.local/bin//dunk", line 8, in <module>
    sys.exit(main())
  File "/home/***/.local/pipx/venvs/dunk/lib/python3.10/site-packages/dunk/dunk.py", line 119, in main
    target_code = target_file.read_text()
  File "/usr/lib/python3.10/pathlib.py", line 1132, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.10/pathlib.py", line 1117, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/home/***/.config/.config/test_dir/test_file'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant