Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Handa committed Sep 16, 2020
1 parent 8be883a commit f6f6bee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func newDir(d *os.File) (*dir, error) {
var gitRepoStatus map[string]string // could be nil
if flagVector&flag_D > 0 {
gitRepoStatus = getFilesGitStatus(d.Name()) // returns map or nil
if len(gitRepoStatus) == 0 {
gitRepoStatus = nil
}
}

if curDir {
Expand Down
2 changes: 1 addition & 1 deletion gitStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func getRepoStatus(path string) (git.Status, string, error) {

func getFilesGitStatus(p string) map[string]string {
gitRepo, gitRoot, err := getRepoStatus(p)
if err != nil {
if err != nil || len(gitRepo) == 0 {
return nil
}
pAbs, err := filepath.Abs(p)
Expand Down

0 comments on commit f6f6bee

Please sign in to comment.