mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Audit rev-parse users again.
Some callers to rev-parse were using the output selection flags inconsistently. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
4866ccf0f4
commit
ff84d327df
|
@ -58,7 +58,7 @@ bisect_start() {
|
||||||
bisect_bad() {
|
bisect_bad() {
|
||||||
bisect_autostart
|
bisect_autostart
|
||||||
case "$#" in 0 | 1) ;; *) usage ;; esac
|
case "$#" in 0 | 1) ;; *) usage ;; esac
|
||||||
rev=$(git-rev-parse --revs-only --verify --default HEAD "$@") || exit
|
rev=$(git-rev-parse --verify --default HEAD "$@") || exit
|
||||||
echo "$rev" > "$GIT_DIR/refs/bisect/bad"
|
echo "$rev" > "$GIT_DIR/refs/bisect/bad"
|
||||||
bisect_auto_next
|
bisect_auto_next
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ bisect_good() {
|
||||||
bisect_autostart
|
bisect_autostart
|
||||||
case "$#" in
|
case "$#" in
|
||||||
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
|
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
|
||||||
*) revs=$(git-rev-parse --revs-only "$@") || exit ;;
|
*) revs=$(git-rev-parse --revs-only --no-flags "$@") || exit ;;
|
||||||
esac
|
esac
|
||||||
for rev in $revs
|
for rev in $revs
|
||||||
do
|
do
|
||||||
|
|
|
@ -25,7 +25,7 @@ case "$#" in
|
||||||
head="$2^0" ;;
|
head="$2^0" ;;
|
||||||
esac
|
esac
|
||||||
branchname="$1"
|
branchname="$1"
|
||||||
rev=$(git-rev-parse --revs-only --verify "$head") || exit
|
rev=$(git-rev-parse --verify "$head") || exit
|
||||||
|
|
||||||
[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
|
[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
revs=$(git-rev-parse --revs-only --default HEAD "$@") || exit
|
revs=$(git-rev-parse --revs-only --no-flags --default HEAD "$@") || exit
|
||||||
[ "$revs" ] || die "No HEAD ref"
|
[ "$revs" ] || die "No HEAD ref"
|
||||||
git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}
|
git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}
|
||||||
|
|
|
@ -19,8 +19,8 @@ head=${3-HEAD}
|
||||||
[ "$revision" ] || usage
|
[ "$revision" ] || usage
|
||||||
[ "$url" ] || usage
|
[ "$url" ] || usage
|
||||||
|
|
||||||
baserev=`git-rev-parse --verify $revision^0` &&
|
baserev=`git-rev-parse --verify "$revision"^0` &&
|
||||||
headrev=`git-rev-parse --verify $head^0` || exit
|
headrev=`git-rev-parse --verify "$head"^0` || exit
|
||||||
|
|
||||||
echo "The following changes since commit $baserev:"
|
echo "The following changes since commit $baserev:"
|
||||||
git log --max-count=1 --pretty=short "$baserev" |
|
git log --max-count=1 --pretty=short "$baserev" |
|
||||||
|
|
|
@ -10,7 +10,7 @@ case "$status" in
|
||||||
die "Your working tree is dirty; cannot revert a previous patch." ;;
|
die "Your working tree is dirty; cannot revert a previous patch." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
rev=$(git-rev-parse --no-flags --verify --revs-only "$@") &&
|
rev=$(git-rev-parse --verify "$@") &&
|
||||||
commit=$(git-rev-parse --verify "$rev^0") || exit
|
commit=$(git-rev-parse --verify "$rev^0") || exit
|
||||||
if git-diff-tree -R -M -p $commit | git-apply --index &&
|
if git-diff-tree -R -M -p $commit | git-apply --index &&
|
||||||
msg=$(git-rev-list --pretty=oneline --max-count=1 $commit)
|
msg=$(git-rev-list --pretty=oneline --max-count=1 $commit)
|
||||||
|
|
Loading…
Reference in a new issue