mirror of
https://github.com/git/git.git
synced 2024-06-02 22:16:11 +02:00
[PATCH] Audit rev-parse users.
This patch changes rev-parse users that pass a single argument that is supposed to be a rev parameter to use "--verify". Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
a38e727925
commit
f6e1a4d6dc
|
@ -22,7 +22,7 @@ while [ "$#" != "0" ]; do
|
||||||
force=1
|
force=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
rev=$(git-rev-parse --verify --revs-only "$arg^0") || exit
|
rev=$(git-rev-parse --verify "$arg^0") || exit
|
||||||
if [ -z "$rev" ]; then
|
if [ -z "$rev" ]; then
|
||||||
echo "unknown flag $arg"
|
echo "unknown flag $arg"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -28,11 +28,11 @@ The output is intended to be used as:
|
||||||
'
|
'
|
||||||
|
|
||||||
case "$#" in
|
case "$#" in
|
||||||
1) linus=`git-rev-parse "$1"` &&
|
1) linus=`git-rev-parse --verify "$1"` &&
|
||||||
junio=`git-rev-parse HEAD` || exit
|
junio=`git-rev-parse --verify HEAD` || exit
|
||||||
;;
|
;;
|
||||||
2) linus=`git-rev-parse "$1"` &&
|
2) linus=`git-rev-parse --verify "$1"` &&
|
||||||
junio=`git-rev-parse "$2"` || exit
|
junio=`git-rev-parse --verify "$2"` || exit
|
||||||
;;
|
;;
|
||||||
*) echo >&2 "$usage"; exit 1 ;;
|
*) echo >&2 "$usage"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -16,7 +16,7 @@ do
|
||||||
-m) shift
|
-m) shift
|
||||||
case "$#" in
|
case "$#" in
|
||||||
0) usage ;;
|
0) usage ;;
|
||||||
*) use_commit=`git-rev-parse "$1"` ||
|
*) use_commit=`git-rev-parse --verify "$1"` ||
|
||||||
exit ;;
|
exit ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -11,11 +11,11 @@ upstream tree.'
|
||||||
: ${GIT_DIR=.git}
|
: ${GIT_DIR=.git}
|
||||||
|
|
||||||
case "$#" in
|
case "$#" in
|
||||||
1) linus=`git-rev-parse "$1"` &&
|
1) linus=`git-rev-parse --verify "$1"` &&
|
||||||
junio=`git-rev-parse HEAD` || exit
|
junio=`git-rev-parse --verify HEAD` || exit
|
||||||
;;
|
;;
|
||||||
2) linus=`git-rev-parse "$1"` &&
|
2) linus=`git-rev-parse --verify "$1"` &&
|
||||||
junio=`git-rev-parse "$2"` || exit
|
junio=`git-rev-parse --verify "$2"` || exit
|
||||||
;;
|
;;
|
||||||
*) echo >&2 "$usage"; exit 1 ;;
|
*) echo >&2 "$usage"; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#
|
#
|
||||||
. git-sh-setup-script || die "Not a git archive"
|
. git-sh-setup-script || die "Not a git archive"
|
||||||
|
|
||||||
head=$(git-rev-parse --revs-only "$1")
|
head=$(git-rev-parse --verify "$1")
|
||||||
merge=$(git-rev-parse --revs-only "$2")
|
merge=$(git-rev-parse --verify "$2")
|
||||||
merge_msg="$3"
|
merge_msg="$3"
|
||||||
|
|
||||||
dropheads() {
|
dropheads() {
|
||||||
|
|
Loading…
Reference in New Issue