Fix branch preview for branches that have the same name as a file (#374)

The preview for branches (when using gbd or gcb) did not work for branches that have the same name as a file in the repository. This commit fixes this behavior by separating files and revisions with '--' as git suggests, while leaving the files blank to keep matching all files.
This commit is contained in:
sandr01d 2024-03-31 00:31:48 +01:00 committed by GitHub
parent 1a1153978f
commit 032b52f6d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -742,7 +742,9 @@ _forgit_checkout_commit() {
}
_forgit_branch_preview() {
git log "$1" "${_forgit_log_preview_options[@]}"
# the trailing '--' ensures that this works for branches that have a name
# that is identical to a file
git log "$1" "${_forgit_log_preview_options[@]}" --
}
_forgit_git_branch_delete() {