Commit a59672ab authored by Loic Nageleisen's avatar Loic Nageleisen
Browse files

Handle non-git patches

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 #1159
parent b6428c7a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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