Skip to content

Commit

Permalink
beesh: start guessing patch striplevels with 1 then 0
Browse files Browse the repository at this point in the history
if a patch only contains new files from e.g. a git format-patch, the guess of
strip level 0 will succeed. This should be wrong most of the time, because
those files will be created in a subdirectory 'b' ..

So we now start guessing with striplevel 1 followed by 0 instead of starting
by 0 followed by 1 ..
  • Loading branch information
mariux committed Mar 16, 2012
1 parent a173174 commit 8e4af37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function bee_patch() {
for p in ${bee_P[@]} ; do
striplevel=1

for i in 0 1 2 3 4 5 6 7 8 9 ; do
for i in 1 0 2 3 4 5 6 7 8 9 ; do
if patch --dry-run -N -p$i -i "${p}" >/dev/null 2>&1 ; then
striplevel=$i
print_info "bee_patch(): ${p##*/}: guessed patch striplevel of ${striplevel} .."
Expand Down

0 comments on commit 8e4af37

Please sign in to comment.