Skip to content

Commit a0d5806

Browse files
committed
Fall back to 'tac' when 'rev' is not available
- should allow toolbelt to run in Git Bash on Windows - closes nvie#29 (hopefully)
1 parent 6972ff8 commit a0d5806

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-modified

+3-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ if [ -z "$commit" ]; then
113113
fi
114114
else
115115
TAB=" " # literal tab char
116-
git log -1 --name-status --pretty=format:"" "$commit" | cut -f2- | rev | cut -d"$TAB" -f1 | rev | make_relative | while read f; do
116+
rev='rev'
117+
type rev >/dev/null 2>&1 || rev='tac'
118+
git log -1 --name-status --pretty=format:"" "$commit" | cut -f2- | $rev | cut -d"$TAB" -f1 | $rev | make_relative | while read f; do
117119
if [ -f "$f" ]; then
118120
echo "$f"
119121
fi

0 commit comments

Comments
 (0)