tj / git-extras

GIT utilities -- repo summary, repl, changelog population, author commit percentages and more
MIT License
17.3k stars 1.21k forks source link

fix: Use absolute (relative to repo root) path to supplied filename #1152

Open mattcen opened 1 month ago

mattcen commented 1 month ago

If a file is referenced from the subdir of a repository, the script confirms it exists and tacks the filename onto the URL, but doesn't check if the filename provided is relative to the repo root.

I couldn't immediately work out the best way to update the tests to:

  1. Create a temp dir inside the existing temp repo
  2. Create a new temp file within that new dir
  3. Change CWD to the new dir
  4. Run git-browse on that new file with a relative path