[PATCH] Allow file removal when "git commit --all" is used.
[git/jnareb-git.git] / git-reset-script
blob7da8d86823b09a6fa9a5c5d28dcc849253843181
1 #!/bin/sh
2 . git-sh-setup-script || die "Not a git archive"
3 rev=$(git-rev-parse --verify --default HEAD "$@") || exit
4 rev=$(git-rev-parse --verify $rev^0) || exit
5 git-read-tree --reset "$rev" && {
6 if orig=$(git-rev-parse --verify HEAD 2>/dev/null)
7 then
8 echo "$orig" >"$GIT_DIR/ORIG_HEAD"
9 fi
10 echo "$rev" > "$GIT_DIR/HEAD"
12 git-update-cache --refresh
13 rm -f "$GIT_DIR/MERGE_HEAD"