diff --git a/runtime/plugins/status/status.lua b/runtime/plugins/status/status.lua index ae1f77a6..90b2f0c1 100644 --- a/runtime/plugins/status/status.lua +++ b/runtime/plugins/status/status.lua @@ -3,7 +3,9 @@ VERSION = "1.0.0" local micro = import("micro") local buffer = import("micro/buffer") local config = import("micro/config") +local shell = import("micro/shell") local humanize = import("humanize") +local strings = import("strings") function init() micro.SetStatusInfoFn("status.branch") @@ -34,9 +36,6 @@ end function branch(b) if b.Type.Kind ~= buffer.BTInfo then - local shell = import("micro/shell") - local strings = import("strings") - local branch, err = shell.ExecCommand("git", "rev-parse", "--abbrev-ref", "HEAD") if err == nil then return strings.TrimSpace(branch) @@ -47,9 +46,6 @@ end function hash(b) if b.Type.Kind ~= 5 then - local shell = import("micro/shell") - local strings = import("strings") - local hash, err = shell.ExecCommand("git", "rev-parse", "--short", "HEAD") if err == nil then return strings.TrimSpace(hash)