Commit 6e210706a4224007cf266b48c28e5a54e8279589

Stefan Sperling 2021-01-22T23:49:46

implicitly mark all files in work tree as up-to-date after 'got integrate' Avoids having to run 'got update' for no good reason after 'got integrate'. The same change was made recently for both rebase and histedit in commit a615e0e7796ea1103a6e0d4b5dbb6134597886660 and we forgot about histedit.

diff --git a/lib/worktree.c b/lib/worktree.c
index 6861483..e81fcf0 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -7108,6 +7108,10 @@ got_worktree_integrate_continue(struct got_worktree *worktree,
 		goto sync;
 
 	err = got_ref_write(base_branch_ref, repo);
+	if (err)
+		goto sync;
+
+	err = bump_base_commit_id_everywhere(worktree, fileindex, NULL, NULL);
 sync:
 	sync_err = sync_fileindex(fileindex, fileindex_path);
 	if (sync_err && err == NULL)
diff --git a/regress/cmdline/integrate.sh b/regress/cmdline/integrate.sh
index 8cf8d28..603d729 100755
--- a/regress/cmdline/integrate.sh
+++ b/regress/cmdline/integrate.sh
@@ -136,6 +136,16 @@ test_integrate_basic() {
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
+		test_done "$testroot" "$ret"
+		return 1
+	fi
+
+	(cd $testroot/wt && got update > $testroot/stdout)
+	echo "Already up-to-date" > $testroot/stdout.expected
+	cmp -s $testroot/stdout.expected $testroot/stdout
+	ret="$?"
+	if [ "$ret" != "0" ]; then
+		diff -u $testroot/stdout.expected $testroot/stdout
 	fi
 	test_done "$testroot" "$ret"
 }