diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-11-05 15:58:50 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-11-05 15:58:50 +0000 |
commit | dc0bb76da986103ccf14595852cc301de6eaae4b (patch) | |
tree | 14bbb4d768423f7956125f7c8f152c8a30e15d00 | |
parent | e3df3ec1733c4021c4491c7a0d00c8ea4bf71c56 (diff) | |
download | gitano-dc0bb76da986103ccf14595852cc301de6eaae4b.tar.bz2 |
Support committing to adminrefs with author/committer different
-rw-r--r-- | lib/gitano/repository.lua | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua index fe38695..3cd1d30 100644 --- a/lib/gitano/repository.lua +++ b/lib/gitano/repository.lua @@ -658,7 +658,7 @@ function repo_method:update_modified_date(shas) return true end -function repo_method:save_admin(reason, username) +function repo_method:save_admin(reason, author, committer) local cursha = self.git:get_ref(adminrefname) local curcommit = self.git:get(cursha) local flat_tree = gall.tree.flatten(curcommit.content.tree.content) @@ -683,15 +683,19 @@ function repo_method:save_admin(reason, username) if not tree then return nil, msg end - local person = (username and { - realname = self.config.users[username].real_name, - email = self.config.users[username].email_address - }) or admin_name + author = (author and { + realname = self.config.users[author].real_name, + email = self.config.users[author].email_address + }) or admin_name + committer = (committer and { + realname = self.config.users[committer].real_name, + email = self.config.users[committer].email_address + }) or author -- Now a commit of the blob, using the gitano admin identity local commit, msg = gall.commit.create(self.git, { - author = person, - committer = person, + author = author, + committer = committer, message = reason or "Updated admin tree", tree = tree, parents = { curcommit } |