Skip to content

Commit

Permalink
fix(git): handle non-unix stderr redirection (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry authored Jun 27, 2024
1 parent ae770c6 commit 3d20b9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/git-dashboard-nvim/git.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
local utils = require("git-dashboard-nvim.utils")
local config = require("git-dashboard-nvim.config")
local is_windows = vim.fn.has("win32")
local null = is_windows and "NUL" or "/dev/null"

Git = {}

---@return string
Git.get_repo_with_owner = function()
local handle = io.popen("git remote get-url origin 2>/dev/null")
local handle = io.popen("git remote get-url origin 2>" .. null)
if not handle then
return ""
end
Expand Down Expand Up @@ -95,7 +97,7 @@ end

---@return string
Git.get_current_branch = function()
local handle = io.popen("git branch --show-current 2>/dev/null")
local handle = io.popen("git branch --show-current 2>" .. null)
if not handle then
return ""
end
Expand Down

0 comments on commit 3d20b9a

Please sign in to comment.