-
-
Notifications
You must be signed in to change notification settings - Fork 942
add author and committer in params of the commit function #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,7 +254,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream): | |
|
||
|
||
@classmethod | ||
def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False): | ||
def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False, author=None, committer=None): | ||
"""Commit the given tree, creating a commit object. | ||
|
||
:param repo: Repo object the commit should be part of | ||
|
@@ -299,8 +299,13 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False): | |
cr = repo.config_reader() | ||
env = os.environ | ||
|
||
committer = Actor.committer(cr) | ||
author = Actor.author(cr) | ||
if author is None and committer is None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This input check should be simplified. |
||
committer = Actor.committer(cr) | ||
author = Actor.author(cr) | ||
elif author is None: | ||
author = Actor.author(cr) | ||
elif committer is None: | ||
committer = Actor.committer(cr) | ||
|
||
# PARSE THE DATES | ||
unix_time = int(time()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,7 +247,7 @@ def append_entry(cls, config_reader, filepath, oldbinsha, newbinsha, message): | |
raise ValueError("Shas need to be given in binary format") | ||
#END handle sha type | ||
assure_directory_exists(filepath, is_file=True) | ||
entry = RefLogEntry((bin_to_hex(oldbinsha), bin_to_hex(newbinsha), Actor.committer(config_reader), (int(time.time()), time.altzone), message)) | ||
entry = RefLogEntry((bin_to_hex(oldbinsha), bin_to_hex(newbinsha), config_reader, (int(time.time()), time.altzone), message)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
lf = LockFile(filepath) | ||
lf._obtain_lock_or_raise() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -355,7 +355,7 @@ def log_append(self, oldbinsha, message, newbinsha=None): | |
:param newbinsha: The sha the ref points to now. If None, our current commit sha | ||
will be used | ||
:return: added RefLogEntry instance""" | ||
return RefLog.append_entry(self.repo.config_reader(), RefLog.path(self), oldbinsha, | ||
return RefLog.append_entry(self.commit.committer, RefLog.path(self), oldbinsha, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
(newbinsha is None and self.commit.binsha) or newbinsha, | ||
message) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added parameters are not yet documented in
Commit.create_from_tree
.