Skip to content

Commit

Permalink
Handle Git Bash for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorenar committed Nov 8, 2023
1 parent 3eb8c77 commit 72b6bf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In that case, you are in the right place!

## Dependencies

* POSIX compatible shell (e.g. [Dash](http://gondor.apana.org.au/~herbert/dash/), [Bash](https://www.gnu.org/software/bash/))
* POSIX compatible shell (e.g. [Dash](http://gondor.apana.org.au/~herbert/dash/), [Bash](https://www.gnu.org/software/bash/), KornShell, [Git Bash for Windows](https://gitforwindows.org/))
* [Git](https://git-scm.com/)
* [Vim](https://www.vim.org/) _(optional)_ - for config-less filetype detection
* a formatter program of your choice
Expand Down
6 changes: 4 additions & 2 deletions git-fmt-diff
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ git_diff () (
# shellcheck disable=SC2086
git diff $color "$b_raw" "$chng_fmt" | \
sed \
-e "s/$(sed_esc -p "a$b_raw")/$(sed_esc -s a/"$filename")/g" \
-e "s/$(sed_esc -p "b$chng_fmt")/$(sed_esc -s b/"$filename")/g"
-e "s/a\/*$(sed_esc -p "$b_raw")/$(sed_esc -s a/"$filename")/g" \
-e "s/b\/*$(sed_esc -p "$chng_fmt")/$(sed_esc -s b/"$filename")/g"
)

git_retrieve_file_from_sha () (
Expand Down Expand Up @@ -576,6 +576,8 @@ g_rm_list="$(mktemp)"
rm_list__push "$TMPDIR"
rm_list__push "$g_rm_list"

pwd -W > /dev/null 2>&1 && TMPDIR="$(cd "$TMPDIR" && pwd -W)"

trap 'cleanup' EXIT
# }}}2

Expand Down

0 comments on commit 72b6bf1

Please sign in to comment.