Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 43 lines (33 sloc) 777 Bytes
#!/bin/sh
#
# Copyright (c) Josef "Jeff" Sipek, 2006, 2007
#
USAGE="[-k] <patchname>"
. `dirname $0`/guilt
if [ "$1" = "-k" ]; then
keep=t
shift
fi
if [ $# -ne 1 ]; then
usage
fi
patch="$1"
if [ -z "$patch" ]; then
die "No patch name supplied."
fi
# make sure it is a file
if [ ! -f "$GUILT_DIR/$branch/$patch" ]; then
die "Patch $patch does not exist."
fi
# make sure that there are no unapplied changes
if ! must_commit_first; then
die "Uncommited changes detected. Refresh first."
fi
# make sure it is not applied
pline=`cat $applied | grep -e "^$patch$"`
if [ ! -z "$pline" ]; then
die "Patch is applied. Pop the patch first."
fi
fold_patch "$patch"
# back it up just in case :)
[ -z "$keep" ] && mv "$GUILT_DIR/$branch/$patch" "$GUILT_DIR/$branch/$patch~"
Jump to Line
Something went wrong with that request. Please try again.