go-git

go-git reports a file as Untracked while it should be Unmodified

好久不见. 提交于 2020-07-10 10:27:23
问题 I am trying to check the status of a particular file in a git repo using go-git library. This is the code I am attempting to run: repo, err := git.PlainOpen(fullPathToRepo) if err != nil { return false, fmt.Errorf("ERROR: Unable to open repository %s\n%s", fullPathToRepo, err) } workTree, err := repo.Worktree() if err != nil { return false, fmt.Errorf("ERROR: Unable to open worktree for repository %s\n%s", fullPathToRepo, err) } workTreeStatus, err := workTree.Status() if err != nil { return

go-git reports a file as Untracked while it should be Unmodified

那年仲夏 提交于 2020-07-10 10:26:25
问题 I am trying to check the status of a particular file in a git repo using go-git library. This is the code I am attempting to run: repo, err := git.PlainOpen(fullPathToRepo) if err != nil { return false, fmt.Errorf("ERROR: Unable to open repository %s\n%s", fullPathToRepo, err) } workTree, err := repo.Worktree() if err != nil { return false, fmt.Errorf("ERROR: Unable to open worktree for repository %s\n%s", fullPathToRepo, err) } workTreeStatus, err := workTree.Status() if err != nil { return