mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Currently, the command will print following message twice when not called in git repo. ``` fatal: not a git repository (or any parent up to mount point /google) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). ``` Bug: 339231299 Change-Id: Iab05e037a81b7e15dcc011d78480cd9ace7c7e36 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5544438 Commit-Queue: Yiwei Zhang <yiwzhang@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
12 lines
335 B
Bash
Executable File
12 lines
335 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
if git rev-parse 2> /dev/null; then
|
|
git checkout "$(git rev-parse --abbrev-ref "@{u}")"
|
|
else
|
|
echo "error: not in a git repository" >&2
|
|
exit 1
|
|
fi
|