File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -213,14 +213,20 @@ local function get_current_repo_branch(repo)
213
213
if p then
214
214
local data = p :read (" *a" )
215
215
p :close ()
216
- branch = string.match (data , " \n %* (.-)\n " )
216
+ local branches = du .split (data , " \n " )
217
+ for _ , b in ipairs (branches ) do
218
+ log .msg (log .debug , " branch for testing is " .. b )
219
+ branch = string.match (b , " ^%* (.-)$" )
220
+ if branch then
221
+ log .msg (log .info , " current repo branch is " .. branch )
222
+ return branch
223
+ end
224
+ end
217
225
end
218
226
if not branch then
219
227
log .msg (log .error , " no current branch detected in repo_data" )
220
- else
221
- log .msg (log .info , " current repo branch is " .. branch )
222
228
end
223
- return branch
229
+ return nil
224
230
end
225
231
226
232
local function get_repo_branches (repo )
You can’t perform that action at this time.
0 commit comments