3 # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
14 if [ -z "$patch" ]; then
15 die
"No patch name supplied."
18 # make sure that there are no unapplied changes
19 if ! must_commit_first
; then
20 die
"Uncommited changes detected. Refresh first."
23 # make sure it is not applied
24 pline
=`cat $applied | grep -e "^[0-9a-f]\{40\}:$patch\$"`
25 if [ ! -z "$pline" ]; then
26 die
"Patch is applied. Pop the patch first."
29 # make sure it is a file
30 if [ ! -f "$GUILT_DIR/$branch/$patch" ]; then
31 die
"Patch '$patch' is not a regular file."
36 # back it up just in case :)