-
Notifications
You must be signed in to change notification settings - Fork 820
Closed
Milestone
Description
Development environment details:
- Ubuntu 23.10
- git 2.40.1
- go-git v5.11.0
cat ~/.gitconfig
[merge]
ff = false
I have a modified file (echo "new line" >> readme.txt).
If I run this code, I got a modified file in worktree and index at the same time with the same content.
If I run git add file, this will be added correctly :
r,err := git.PlainOpen(dir)
w, err := r.Worktree()
w.Add(file)
git diff
shows no changes:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: readme.md
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: readme.md
If I run git add file
, the output is like that:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: readme.md
joshmeranda
Metadata
Metadata
Assignees
Labels
No labels