From 96bc70fff880fc36f12694981bd4aae1c712e891 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 19 Feb 2022 14:13:38 +0530 Subject: [PATCH] Revert "nvim: autoload/git: Fix git log when current branch is master/main" This reverts commit da5671b5ae55085e59aa7852dd5210e35314ac8f. The commit actually did not handle all cases correctly. --- nvim/.config/nvim/autoload/git.vim | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/nvim/.config/nvim/autoload/git.vim b/nvim/.config/nvim/autoload/git.vim index 555e22c..c5d545c 100644 --- a/nvim/.config/nvim/autoload/git.vim +++ b/nvim/.config/nvim/autoload/git.vim @@ -47,13 +47,9 @@ endfunction function! git#git_branch_log() abort let line = trim(getline('.')) let branch = split(line, "/") - let current = trim(system('git branch --show-current')) " Close the buffer opened by Git branch -a silent execute "bw" - if current == "master" || current == "main" - " Handles the case for checked out main/master branch - execute "Git log " . current - elseif len(branch) == 1 + if len(branch) == 1 " Handles the case for local branch execute "Git log " . branch[0] else @@ -69,13 +65,9 @@ endfunction function! git#git_branch_log_pretty() abort let line = trim(getline('.')) let branch = split(line, "/") - let current = trim(system('git branch --show-current')) " Close the buffer opened by Git branch -a silent execute "bw" - if current == "master" || current == "main" - " Handles the case for checked out main/master branch - execute "Git log " . current - elseif len(branch) == 1 + if len(branch) == 1 " Handles the case for local branch execute "Git log --pretty=oneline --no-merges " . branch[0] else