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

Get git repository from file path instead of current directory #22

Closed
sharkdp opened this issue Apr 30, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@sharkdp
Copy link
Owner

commented Apr 30, 2018

Inside the repo:

some/folder/repo > bat test.md

▶ bat test.md
───────┬─────────────────────────────────────────────────────────────────────
       │ File test.md
───────┼─────────────────────────────────────────────────────────────────────
...
  19   │ 
  20 + │ <div>
  21 + │ huhu
  22 + │ </div>
───────┴─────────────────────────────────────────────────────────────────────

Outside the repo:

some/folder > bat repo/test.md

▶ bat test.md
───────┬─────────────────────────────────────────────────────────────────────
       │ File test.md
───────┼─────────────────────────────────────────────────────────────────────
...
  19   │ 
  20   │ <div>
  21   │ huhu
  22   │ </div>
───────┴─────────────────────────────────────────────────────────────────────
@jrunning

This comment has been minimized.

Copy link

commented May 4, 2018

This also seems to be an issue when you do bat ../test.md in some/folder/repo/subfolder.

some/folder/repo$ bat test.md
───────┬─────────────────────────────────────────────────────────────────────
       │ File test.md
───────┼─────────────────────────────────────────────────────────────────────
...
  19   │ 
  20 + │ <div>
  21 + │ huhu
  22 + │ </div>
───────┴─────────────────────────────────────────────────────────────────────

some/folder/repo$ cd subfolder

some/folder/repo/subfolder$ bat ../test.md
───────┬─────────────────────────────────────────────────────────────────────
       │ File test.md
───────┼─────────────────────────────────────────────────────────────────────
...
  19   │ 
  20   │ <div>
  21   │ huhu
  22   │ </div>
───────┴─────────────────────────────────────────────────────────────────────
@ghost

This comment has been minimized.

Copy link

commented May 4, 2018

I'd like to try fixing this. From a quick look it looks changing to the Repository::discover call might fix it. But that didn't until I commented out the pathspec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.