From 42d4a82a04d23c385b7cd2cc251951debd7e5af1 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Fri, 26 Nov 2021 20:41:58 +0900 Subject: [PATCH] include/msg/commit: Rename "commit" field to "ref" The field that stores the source-level version in the commit message is named "commit", which is different from the terminology used by git and other development tools. This commit renames the "commit" field of commit messages to "ref". Related functions are also renamed accordingly. --- include/msg/commit.sh | 14 +++++++------- spec/commit.json | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/msg/commit.sh b/include/msg/commit.sh index 65befea..e287a9f 100644 --- a/include/msg/commit.sh +++ b/include/msg/commit.sh @@ -13,14 +13,14 @@ __init() { foundry_msg_commit_new() { local repository="$1" local branch="$2" - local commit="$3" + local ref="$3" local data local msg if ! data=$(json_object "repository" "$repository" \ - "commit" "$commit" \ - "branch" "$branch"); then + "branch" "$branch" \ + "ref" "$ref"); then return 1 fi @@ -58,15 +58,15 @@ foundry_msg_commit_get_branch() { return 0 } -foundry_msg_commit_get_commit() { +foundry_msg_commit_get_ref() { local msg="$1" - local commit + local ref - if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then + if ! ref=$(foundry_msg_get_data_field "$msg" "ref"); then return 1 fi - echo "$commit" + echo "$ref" return 0 } diff --git a/spec/commit.json b/spec/commit.json index 7b155c9..bb8a2da 100644 --- a/spec/commit.json +++ b/spec/commit.json @@ -16,8 +16,8 @@ "type": "string" }, - "commit": { - "description": "The hash of the detected commit", + "ref": { + "description": "Identifier of the source code version", "type": "string", "pattern": "^[0-9a-fA-F]+$" } @@ -26,6 +26,6 @@ "required": [ "repository", "commit", - "branch" + "ref" ] } -- 2.47.3