File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -393,8 +393,13 @@ local function get_git_remote(git_dir, branch)
393393 local file = io.open (git_dir .. " /config" , ' r' )
394394 if not file then return nil end
395395
396- local git_config = {};
397- local section ;
396+ local git_config = {}
397+
398+ local function get_git_config_value (section , param )
399+ return git_config [section ] and git_config [section ][param ] or nil
400+ end
401+
402+ local section
398403 for line in file :lines () do
399404 if (line :sub (1 ,1 ) == " [" and line :sub (- 1 ) == " ]" ) then
400405 if (line :sub (2 ,5 ) == " lfs " ) then
@@ -410,11 +415,7 @@ local function get_git_remote(git_dir, branch)
410415 end
411416 end
412417 end
413- file :close ();
414-
415- local function get_git_config_value (section , param )
416- return git_config [section ] and git_config [section ][param ] or nil
417- end
418+ file :close ()
418419
419420 local remote_to_push = get_git_config_value (' branch "' .. branch .. ' "' , ' remote' ) or ' '
420421 local remote_ref = get_git_config_value (' remote "' .. remote_to_push .. ' "' , ' push' ) or
You can’t perform that action at this time.
0 commit comments