Skip to content

Commit

Permalink
shellcheck-gitrange.bash: cd $(git rev-parse --show-toplevel)
Browse files Browse the repository at this point in the history
... because git outputs relative paths

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb authored and xiulipan committed Oct 27, 2020
1 parent bfcc68c commit d2c0d1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/shellcheck-gitrange.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ set -e

main()
{
# git outputs relative paths
local git_top; git_top=$(git rev-parse --show-toplevel)
cd "$git_top"

# The rest of args is passed as is to shellcheck
local diffrange="$1"; shift

Expand Down

0 comments on commit d2c0d1e

Please sign in to comment.