Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9780b7a

Browse files
committed
Merge branch '0.3' ofhttps://github.com/firm1/GitPython into firm1-0.3
Fixed most pressing issues, more to come in next commit as we introduceda regression here.Conflicts:git/objects/commit.pygit/refs/log.pygit/refs/symbolic.py
2 parents322db07 +3a1e0d7 commit9780b7a

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

‎git/index/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ def move(self, items, skip_errors=False, **kwargs):
867867

868868
returnout
869869

870-
defcommit(self,message,parent_commits=None,head=True):
870+
defcommit(self,message,parent_commits=None,head=True,author=None,committer=None):
871871
"""Commit the current default index file, creating a commit object.
872872
873873
For more information on the arguments, see tree.commit.
@@ -878,7 +878,7 @@ def commit(self, message, parent_commits=None, head=True):
878878
:return:
879879
Commit object representing the new commit"""
880880
tree=self.write_tree()
881-
returnCommit.create_from_tree(self.repo,tree,message,parent_commits,head)
881+
returnCommit.create_from_tree(self.repo,tree,message,parent_commits,head,author=author,committer=committer)
882882

883883
@classmethod
884884
def_flush_stdin_and_wait(cls,proc,ignore_stdout=False):

‎git/objects/commit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream):
258258
finalize_process(proc_or_stream)
259259

260260
@classmethod
261-
defcreate_from_tree(cls,repo,tree,message,parent_commits=None,head=False):
261+
defcreate_from_tree(cls,repo,tree,message,parent_commits=None,head=False,author=None,committer=None):
262262
"""Commit the given tree, creating a commit object.
263263
264264
:param repo: Repo object the commit should be part of
@@ -303,8 +303,8 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False):
303303
cr=repo.config_reader()
304304
env=os.environ
305305

306-
committer=Actor.committer(cr)
307-
author=Actor.author(cr)
306+
committer=committerorActor.committer(cr)
307+
author=authororActor.author(cr)
308308

309309
# PARSE THE DATES
310310
unix_time=int(time())

‎git/refs/log.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def append_entry(cls, config_reader, filepath, oldbinsha, newbinsha, message):
235235
"""Append a new log entry to the revlog at filepath.
236236
237237
:param config_reader: configuration reader of the repository - used to obtain
238-
user information. May be None
238+
user information. May also be an Actor instance identifying the committer directly.
239+
May also be None
239240
:param filepath: full path to the log file
240241
:param oldbinsha: binary sha of the previous commit
241242
:param newbinsha: binary sha of the current commit
@@ -249,8 +250,9 @@ def append_entry(cls, config_reader, filepath, oldbinsha, newbinsha, message):
249250
raiseValueError("Shas need to be given in binary format")
250251
#END handle sha type
251252
assure_directory_exists(filepath,is_file=True)
252-
entry=RefLogEntry((bin_to_hex(oldbinsha),bin_to_hex(newbinsha),Actor.committer(config_reader), (int(time.time()),time.altzone),message))
253-
253+
committer=isinstance(config_reader,Actor)andconfig_readerorActor.committer(config_reader)
254+
entry=RefLogEntry((bin_to_hex(oldbinsha),bin_to_hex(newbinsha),committer, (int(time.time()),time.altzone),message))
255+
254256
lf=LockFile(filepath)
255257
lf._obtain_lock_or_raise()
256258

‎git/refs/symbolic.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,11 @@ def log_append(self, oldbinsha, message, newbinsha=None):
355355
:param newbinsha: The sha the ref points to now. If None, our current commit sha
356356
will be used
357357
:return: added RefLogEntry instance"""
358-
returnRefLog.append_entry(self.repo.config_reader(),RefLog.path(self),oldbinsha,
359-
(newbinshaisNoneandself.commit.binsha)ornewbinsha,
360-
message)
358+
# NOTE: we use the committer of the currently active commit - this should be
359+
# correct. See https://github.com/gitpython-developers/GitPython/pull/146
360+
returnRefLog.append_entry(self.commit.committer,RefLog.path(self),oldbinsha,
361+
(newbinshaisNoneandself.commit.binsha)ornewbinsha,
362+
message)
361363

362364
deflog_entry(self,index):
363365
""":return: RefLogEntry at the given index

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp