Commit Diff


commit - 2575b0eb75bab8aee15d4582f60496382ddfa492
commit + 62870f63a13343aa2c9f3dea24bd565504ca614d
blob - dc83fb12f76947b7bfc4b757eccf6bf68f887e28
blob + cc8cb2913d7de3e412451d9f278af20c5f6c68b1
--- got/got.c
+++ got/got.c
@@ -3393,7 +3393,8 @@ list_tags(struct got_repository *repo, struct got_work
 }
 
 static const struct got_error *
-get_tag_message(char **tagmsg, const char *commit_id_str, const char *repo_path)
+get_tag_message(char **tagmsg, const char *commit_id_str,
+    const char *tag_name, const char *repo_path)
 {
 	const struct got_error *err = NULL;
 	char *template = NULL, *initial_content = NULL;
@@ -3405,8 +3406,8 @@ get_tag_message(char **tagmsg, const char *commit_id_s
 		goto done;
 	}
 
-	if (asprintf(&initial_content, "\n# tagging commit %s\n",
-	    commit_id_str) == -1) {
+	if (asprintf(&initial_content, "\n# tagging commit %s as %s\n",
+	    commit_id_str, tag_name) == -1) {
 		err = got_error_from_errno("asprintf");
 		goto done;
 	}
@@ -3496,7 +3497,7 @@ add_tag(struct got_repository *repo, const char *tag_n
 
 	if (tagmsg_arg == NULL) {
 		err = get_tag_message(&tagmsg, commit_id_str,
-		    got_repo_get_path(repo));
+		    tag_name, got_repo_get_path(repo));
 		if (err)
 			goto done;
 	}