gq-push should exit with non-zero value if there are rejects & regression test for...
[guilt.git] / gq-delete
blob78ba0a976492efcaebebb66c143e53b4bd233f20
1 #!/bin/bash
3 # Copyright (c) Josef "Jeff" Sipek, 2006
6 source "`dirname $0`/gq.lib"
8 export GIT_DIR=`find_git_dir`
9 GQ_DIR="$GIT_DIR/patches"
11 branch=`get_branch_verify`
13 patch="$1"
15 if [ -z "$patch" ]; then
16 echo "You must specify a patch to delete"
17 exit 1
20 p=`cat "$GQ_DIR/$branch/status" | grep -e "^$patch\$"`
21 if [ ! -z "$p" ] ; then
22 echo "Cannot delete an applied patch"
23 exit 1
26 ex -s -c ":%g/^foobar$/d|:wq" "$GQ_DIR/$branch/series"