3 # Copyright (c) Josef "Jeff" Sipek, 2007-2011
7 if [ -z "$GUILT_VERSION" ]; then
8 echo "Invoking $GUILT directly is no longer supported." >&2
18 # make sure that there are no unapplied changes
19 if ! must_commit_first
; then
20 die
"Uncommited changes detected. Refresh first."
24 newbranch
="$branch-`date +%Y-%m-%d`"
29 if [ -e "$GUILT_DIR/$newbranch" ]; then
30 die
"Patch directory for branch \"$newbranch\" already exists."
33 cat "$applied" |
while read n
; do
34 git update-ref
"refs/patches/$newbranch/$n" \
35 `git rev-parse "refs/patches/$branch/$n"` ""
38 if $old_style_prefix ||
[ -z "`get_top 2>/dev/null`" ]
40 newgitbranch
="$newbranch"
42 git update-ref
"refs/heads/$newbranch" "refs/heads/$branch" ""
43 newgitbranch
="$GUILT_PREFIX$newbranch"
46 git branch
"$newgitbranch"
47 git checkout
"$newgitbranch"
49 mkdir
-p "$GUILT_DIR/`dirname $newbranch`"
52 cp_a
"$GUILT_DIR/$branch" "$GUILT_DIR/$newbranch"