Skip to content

Commit ff84d32

Browse files
author
Junio C Hamano
committed
Audit rev-parse users again.
Some callers to rev-parse were using the output selection flags inconsistently. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4866ccf commit ff84d32

5 files changed

+7
-7
lines changed

git-bisect-script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bisect_start() {
5858
bisect_bad() {
5959
bisect_autostart
6060
case "$#" in 0 | 1) ;; *) usage ;; esac
61-
rev=$(git-rev-parse --revs-only --verify --default HEAD "$@") || exit
61+
rev=$(git-rev-parse --verify --default HEAD "$@") || exit
6262
echo "$rev" > "$GIT_DIR/refs/bisect/bad"
6363
bisect_auto_next
6464
}
@@ -67,7 +67,7 @@ bisect_good() {
6767
bisect_autostart
6868
case "$#" in
6969
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
70-
*) revs=$(git-rev-parse --revs-only "$@") || exit ;;
70+
*) revs=$(git-rev-parse --revs-only --no-flags "$@") || exit ;;
7171
esac
7272
for rev in $revs
7373
do

git-branch-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ case "$#" in
2525
head="$2^0" ;;
2626
esac
2727
branchname="$1"
28-
rev=$(git-rev-parse --revs-only --verify "$head") || exit
28+
rev=$(git-rev-parse --verify "$head") || exit
2929

3030
[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
3131

git-log-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
2-
revs=$(git-rev-parse --revs-only --default HEAD "$@") || exit
2+
revs=$(git-rev-parse --revs-only --no-flags --default HEAD "$@") || exit
33
[ "$revs" ] || die "No HEAD ref"
44
git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}

git-request-pull-script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ head=${3-HEAD}
1919
[ "$revision" ] || usage
2020
[ "$url" ] || usage
2121

22-
baserev=`git-rev-parse --verify $revision^0` &&
23-
headrev=`git-rev-parse --verify $head^0` || exit
22+
baserev=`git-rev-parse --verify "$revision"^0` &&
23+
headrev=`git-rev-parse --verify "$head"^0` || exit
2424

2525
echo "The following changes since commit $baserev:"
2626
git log --max-count=1 --pretty=short "$baserev" |

git-revert-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ case "$status" in
1010
die "Your working tree is dirty; cannot revert a previous patch." ;;
1111
esac
1212

13-
rev=$(git-rev-parse --no-flags --verify --revs-only "$@") &&
13+
rev=$(git-rev-parse --verify "$@") &&
1414
commit=$(git-rev-parse --verify "$rev^0") || exit
1515
if git-diff-tree -R -M -p $commit | git-apply --index &&
1616
msg=$(git-rev-list --pretty=oneline --max-count=1 $commit)

0 commit comments

Comments
 (0)