Skip to content

Commit

Permalink
Handle non-git patches
Browse files Browse the repository at this point in the history
Detecting $striplevel relies on a git-specific line, so it is now made
to not depend on a git-specific match that is reliably present in all
patch formats.

Fixes rbenv#1159
  • Loading branch information
lloeki committed Jul 27, 2018
1 parent b6428c7 commit a59672a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ apply_ruby_patch() {
cat "${2:--}" >"$patchfile"

local striplevel=0
grep -q '^diff --git a/' "$patchfile" && striplevel=1
grep -q '^--- a/' "$patchfile" && striplevel=1
patch -p$striplevel --force -i "$patchfile"
;;
esac
Expand Down

0 comments on commit a59672a

Please sign in to comment.