iceberg
iceberg copied to clipboard
Commits through Iceberg unstage changes to ‘README.md’ and other files
trafficstars
Scenario:
- In a Pharo 10 image, load PTerm:
Metacello new repository: 'github://lxsang/PTerm'; baseline: 'PTerm'; load - Using a Terminal window, add a line to ‘README.md’ and add this to the index:

- In a System Browser window, add a method to the class PTerm:
printString ^ super printString - Commit the changes to the PTerm repository through Iceberg
- Using another Terminal window, check
git statusagain:
The change to ‘README.md’ has been unstaged rather than included in the commit.
I used Pharo 10 here because PTerm doesn’t work in Pharo 11 yet, but the issue applies to Pharo 11 as well.
This can be easily fixed by making IceLibgitRepository>>#addFilesToIndex: send #refresh to gitIndex before the send of #addAll:, with LGitIndex>>#refresh implemented as:
refresh
self withReturnHandlerDo: [
self
index_read: self
force: false ]
Then the commit done through Iceberg will include the change to ‘README.md’. It would be nice if the change would also appear in the diff that’s shown before committing. A similar request was made in another issue: https://github.com/pharo-vcs/iceberg/issues/805.