Commit 383ace4b authored by Yuke Liao's avatar Yuke Liao Committed by Commit Bot

Fix git-crrev-parse on Mac.

Previously, running git crrev-parse {crrev_number} on Mac doesn't 
produce any meaningful output, and the reason is that parameter 
substitutions resulted in extra back slashes ('\'):

ref="refs/heads/master"
remote_ref="${ref/refs\/heads/refs\/remotes\/origin}"

expected: remote_ref="refs/remotes/origin/master"
actual: remote_ref="refs\/remotes\/origin/master"

This CL fixes the issue by removing the extra back slashes.

Bug:
Change-Id: I1ee1b4702f09c96fb65518ee1465d0de927e95cc
Reviewed-on: https://chromium-review.googlesource.com/572052Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
parent e5adf612
......@@ -39,6 +39,7 @@ while [ -n "$1" ]; do
fi
remote_ref="${ref/refs\/heads/refs\/remotes\/origin}"
remote_ref="${remote_ref/refs\/branch-heads/refs\/remotes\/branch-heads}"
remote_ref="${remote_ref//\\}"
num="${commit_pos#*@\{\#}"
num="${num%\}}"
if [ -z "$ref" -o -z "$num" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment