Audit rev-parse users.

Make sure that we say --verify when we want to get a single SHA1
name.  Also when we say --verify, --revs-only is redundant.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2005-08-15 15:37:37 -07:00
parent a2f15a812c
commit 2ad77e67c7
3 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ case "$#" in
esac esac
git-read-tree -m -u $ours $upstream && git-read-tree -m -u $ours $upstream &&
echo "$upstream" >"$GIT_DIR/HEAD" || exit git-rev-parse --verify "$upstream^0" >"$GIT_DIR/HEAD" || exit
tmp=.rebase-tmp$$ tmp=.rebase-tmp$$
fail=$tmp-fail fail=$tmp-fail

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
. git-sh-setup-script || die "Not a git archive" . git-sh-setup-script || die "Not a git archive"
rev=$(git-rev-parse --revs-only --verify --default HEAD "$@") || exit rev=$(git-rev-parse --verify --default HEAD "$@") || exit
rev=$(git-rev-parse --revs-only --verify $rev^0) || exit rev=$(git-rev-parse --verify $rev^0) || exit
git-read-tree --reset "$rev" && { git-read-tree --reset "$rev" && {
if orig=$(git-rev-parse --verify HEAD 2>/dev/null) if orig=$(git-rev-parse --verify HEAD 2>/dev/null)
then then

View File

@ -47,7 +47,7 @@ if [ -e "$GIT_DIR/refs/tags/$name" -a -z "$force" ]; then
fi fi
shift shift
object=$(git-rev-parse --verify --revs-only --default HEAD "$@") || exit 1 object=$(git-rev-parse --verify --default HEAD "$@") || exit 1
type=$(git-cat-file -t $object) || exit 1 type=$(git-cat-file -t $object) || exit 1
tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1