Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Git status silently fails in a repository with no commits. #459

@JarrahGos

Description

@JarrahGos

When running the following code on a repository with no commits but staged or untracked content status.IsClean() return true and status.String() returns an empty string. (error checking done, but excluded from example)

status, err := wt.Status()
fmt.Println(status.IsClean())

Normal git functionality is to return the following:

user@work(master|●1…)> git status                                                          
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   name.tex

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	file
	mothen
	name.pdf
	name.txt
	one.tex
	second
	tags
	three.tex
	two.tex
	unclean

user@work(master|●1…)> git l 
fatal: your current branch 'master' does not have any commits yet
user@work(master|●1…)>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions