Skip to content

Commit c96c523

Browse files
authored
Merge pull request darktable-org#342 from wpferguson/sm_fix_no_current_branch
Script Manager crash on no current branch
2 parents ecdc74b + 9a3eb7b commit c96c523

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/script_manager.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ end
210210
local function get_current_repo_branch(repo_data)
211211
local branch = nil
212212
branch = string.match(repo_data, "On branch (.-)\n")
213-
log.msg(log.info, "\ncurrent repo branch is " .. branch)
213+
if not branch then
214+
log.msg(log.error, "no branch detected in repo_data\nrepo_data:\n" .. repo_data)
215+
else
216+
log.msg(log.info, "\ncurrent repo branch is " .. branch)
217+
end
214218
return branch
215219
end
216220

0 commit comments

Comments
 (0)