Skip to content

Commit 72b6bf1

Browse files
committed
Handle Git Bash for Windows
1 parent 3eb8c77 commit 72b6bf1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In that case, you are in the right place!
1818

1919
## Dependencies
2020

21-
* POSIX compatible shell (e.g. [Dash](http://gondor.apana.org.au/~herbert/dash/), [Bash](https://www.gnu.org/software/bash/))
21+
* 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/))
2222
* [Git](https://git-scm.com/)
2323
* [Vim](https://www.vim.org/) _(optional)_ - for config-less filetype detection
2424
* a formatter program of your choice

git-fmt-diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ git_diff () (
311311
# shellcheck disable=SC2086
312312
git diff $color "$b_raw" "$chng_fmt" | \
313313
sed \
314-
-e "s/$(sed_esc -p "a$b_raw")/$(sed_esc -s a/"$filename")/g" \
315-
-e "s/$(sed_esc -p "b$chng_fmt")/$(sed_esc -s b/"$filename")/g"
314+
-e "s/a\/*$(sed_esc -p "$b_raw")/$(sed_esc -s a/"$filename")/g" \
315+
-e "s/b\/*$(sed_esc -p "$chng_fmt")/$(sed_esc -s b/"$filename")/g"
316316
)
317317

318318
git_retrieve_file_from_sha () (
@@ -576,6 +576,8 @@ g_rm_list="$(mktemp)"
576576
rm_list__push "$TMPDIR"
577577
rm_list__push "$g_rm_list"
578578

579+
pwd -W > /dev/null 2>&1 && TMPDIR="$(cd "$TMPDIR" && pwd -W)"
580+
579581
trap 'cleanup' EXIT
580582
# }}}2
581583

0 commit comments

Comments
 (0)