mirror of
https://github.com/sorin-ionescu/prezto.git
synced 2025-01-23 20:22:16 +08:00
Merge 5d09b20421
into 9195b66161
This commit is contained in:
commit
7f46b1f8c9
@ -12,6 +12,8 @@ if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
root="$(command git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
local remotes remote references reference file url
|
local remotes remote references reference file url
|
||||||
|
|
||||||
remote="${1:-origin}"
|
remote="${1:-origin}"
|
||||||
@ -42,7 +44,8 @@ if [[ "$reference" == 'HEAD' ]]; then
|
|||||||
reference="$(command git rev-parse HEAD 2> /dev/null)"
|
reference="$(command git rev-parse HEAD 2> /dev/null)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file="$3"
|
file="${3:-$(pwd)}"
|
||||||
|
file="$(command realpath "$file" | sed "s|^$root||")"
|
||||||
|
|
||||||
if [[ -n "$url" ]]; then
|
if [[ -n "$url" ]]; then
|
||||||
url="$url/tree/$reference/$file"
|
url="$url/tree/$reference/$file"
|
||||||
|
Loading…
Reference in New Issue
Block a user