#!/bin/sh
-. git-sh-setup || die "Not a git archive"
-tmp=/var/tmp/reset.$$
+USAGE='[--mixed | --soft | --hard] [<commit-ish>]'
+. git-sh-setup
+
+tmp=${GIT_DIR}/reset.$$
trap 'rm -f $tmp-*' 0 1 2 3 15
reset_type=--mixed
reset_type="$1"
shift
;;
+-*)
+ usage ;;
esac
rev=$(git-rev-parse --verify --default HEAD "$@") || exit
# it is ok if this fails -- it may already
# have been culled by checkout-index.
unlink $_;
+ while (s|/[^/]*$||) {
+ rmdir($_) or last;
+ }
}
}
' $tmp-exists
;;
esac
-rm -f "$GIT_DIR/MERGE_HEAD"
+rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR"