We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ce7011 commit 3fb3179Copy full SHA for 3fb3179
source/nodegit.js
@@ -190,8 +190,13 @@ class NGWrap {
190
const files = {};
191
for (const f of await r.getStatusExt()) {
192
const fileName = f.path();
193
- const diff = f.indexToWorkdir();
194
- const oldFileName = diff.oldFile().path();
+ let oldFileName;
+ if (!f.isNew()) {
195
+ const diff = f.indexToWorkdir();
196
+ oldFileName = diff.oldFile().path();
197
+ } else {
198
+ oldFileName = fileName;
199
+ }
200
const displayName = f.isRenamed() ? `${oldFileName} → ${fileName}` : fileName;
201
files[fileName] = {
202
fileName,
0 commit comments