commit - 361f1f401c5c6e87c01e86e266887fd5c775afc5
commit + 72fd46fa56e8a73262ff8901b7c93554b7bad3e6
blob - 71909fdc0e45cdb4a1f34f21237d4504b723d1aa
blob + b6130cbd359e573de7f6dc6be70e481d25764d33
--- lib/worktree.c
+++ lib/worktree.c
static const struct got_error *
update_fileindex_after_commit(struct got_pathlist_head *commitable_paths,
- struct got_object_id *new_base_commit_id, struct got_fileindex *fileindex)
+ struct got_object_id *new_base_commit_id, struct got_fileindex *fileindex,
+ int have_staged_files)
{
const struct got_error *err = NULL;
struct got_pathlist_entry *pe;
GOT_FILEIDX_STAGE_NONE);
err = got_fileindex_entry_update(ie,
ct->ondisk_path, ct->staged_blob_id->sha1,
- new_base_commit_id->sha1, 1);
+ new_base_commit_id->sha1,
+ !have_staged_files);
} else
err = got_fileindex_entry_update(ie,
ct->ondisk_path, ct->blob_id->sha1,
- new_base_commit_id->sha1, 1);
+ new_base_commit_id->sha1,
+ !have_staged_files);
} else {
err = got_fileindex_entry_alloc(&ie,
ct->ondisk_path, pe->path, ct->blob_id->sha1,
goto done;
err = update_fileindex_after_commit(&commitable_paths, *new_commit_id,
- fileindex);
+ fileindex, have_staged_files);
sync_err = sync_fileindex(fileindex, fileindex_path);
if (sync_err && err == NULL)
err = sync_err;
goto done;
err = update_fileindex_after_commit(&commitable_paths, *new_commit_id,
- fileindex);
+ fileindex, 0);
sync_err = sync_fileindex(fileindex, fileindex_path);
if (sync_err && err == NULL)
err = sync_err;
blob - abe364148a3057cd534860385de545c80bb5367b
blob + c847136cca4bae60bd72b654eb15593e7739fc09
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
return 1
fi
- echo 'A epsilon/new' > $testroot/stdout.expected
+ echo 'M alpha' > $testroot/stdout.expected
+ echo 'A epsilon/new' >> $testroot/stdout.expected
echo 'D epsilon/zeta' >> $testroot/stdout.expected
+ echo 'M foo' >> $testroot/stdout.expected
echo 'M gamma/delta' >> $testroot/stdout.expected
(cd $testroot/wt && got status > $testroot/stdout)