Commit Diff


commit - 01cd76145e99ea71ca66e60e659e21237b1240e6
commit + d969fa15b6179d07a24a4eb86a60749360741fd8
blob - 032ff72f4376333899d3edb42326d5e6877f2fa2
blob + 42686506992a466294903b32aabb32a6a1a5ddbd
--- got/got.c
+++ got/got.c
@@ -672,6 +672,9 @@ cmd_update(int argc, char *argv[])
 		error = check_same_branch(commit_id, head_ref, repo);
 		if (error)
 			goto done;
+		printf("Switching work tree from %s to %s\n",
+		    got_worktree_get_head_ref_name(worktree),
+		    got_ref_get_name(head_ref));
 		error = got_worktree_set_head_ref(worktree, head_ref);
 		if (error)
 			goto done;
blob - 13de6ccc78b1fffae1913d1010e3af7708972c4e
blob + cb0b3061b30ca3388719ea99878a76213b31de2d
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
@@ -1338,7 +1338,8 @@ function test_update_to_another_branch {
 
 	echo "modified alpha in work tree" > $testroot/wt/alpha
 
-	echo "C  alpha" > $testroot/stdout.expected
+	echo "Switching work tree from refs/heads/master to refs/heads/newbranch" > $testroot/stdout.expected
+	echo "C  alpha" >> $testroot/stdout.expected
 	echo -n "Updated to commit " >> $testroot/stdout.expected
 	git_show_head $testroot/repo >> $testroot/stdout.expected
 	echo >> $testroot/stdout.expected