-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,9 +100,9 @@ end | |
|
||
--- @async | ||
function M:update_abbrev_head() | ||
local info = M.get_info(self.toplevel) | ||
local info, err = M.get_info(self.toplevel) | ||
if not info then | ||
log.eprintf('Could not get info for repo at %s', self.gitdir) | ||
log.eprintf('Could not get info for repo at %s: %s', self.gitdir, err or '') | ||
return | ||
end | ||
self.abbrev_head = info.abbrev_head | ||
|
@@ -212,7 +212,7 @@ end | |
--- @param cwd string | ||
--- @param gitdir? string | ||
--- @param toplevel? string | ||
--- @return Gitsigns.RepoInfo? | ||
--- @return Gitsigns.RepoInfo? info, string? err | ||
function M.get_info(cwd, gitdir, toplevel) | ||
-- Does git rev-parse have --absolute-git-dir, added in 2.13: | ||
-- https://public-inbox.org/git/[email protected]/ | ||
|
@@ -239,13 +239,13 @@ function M.get_info(cwd, gitdir, toplevel) | |
'HEAD', | ||
}) | ||
|
||
local stdout = git_command(args, { | ||
local stdout, stderr, code = git_command(args, { | ||
ignore_error = true, | ||
cwd = toplevel or cwd, | ||
}) | ||
|
||
if not stdout[1] then | ||
return | ||
if code > 0 then | ||
return nil, string.format('got stderr: %s', stderr or '') | ||
end | ||
|
||
local toplevel_r = normalize_path(stdout[1]) | ||
|