Skip to content

Commit 1e7c44f

Browse files
committed
Changed the checking about the original branche while saving a file as a optional - and not default - option
1 parent d08c8e9 commit 1e7c44f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

git-branch-info.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
" Ignore the remote branches. If you don't want information about them, this can
4646
" make things works faster.
4747
"
48+
" let g:git_branch_check_write=<something>
49+
" Check the current branch if it's the same branch where the file was loaded,
50+
" before saving the file.
51+
"
4852
" If you want to make your own customizations, you can use the GitBranchInfoTokens()
4953
" function. It returns an array with the current branch as the first element and
5054
" another array with the other branches as the second element, like:
@@ -67,7 +71,10 @@ let b:git_dir = ""
6771
let b:git_load_branch = ""
6872

6973
autocmd BufEnter * call GitBranchInfoInit()
70-
autocmd BufWriteCmd * call GitBranchInfoWriteCheck()
74+
75+
if exists("g:git_branch_check_write")
76+
autocmd BufWriteCmd * call GitBranchInfoWriteCheck()
77+
endif
7178

7279
function GitBranchInfoCheckGitDir()
7380
return exists("b:git_dir") && !empty(b:git_dir)

0 commit comments

Comments
 (0)