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

Commit7bfd4e6

Browse files
committed
use Commit.replace instead of clone_commit
use Commit.replace fromgitpython-developers/GitPython#1124.
1 parent87d1133 commit7bfd4e6

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

‎editmsg-recurse.py‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@
22
importgit
33

44

5-
defclone_commit(old,**kwargs):
6-
md=dict(
7-
message=old.message,
8-
parent_commits=old.parents,
9-
author=old.author,
10-
committer=old.committer,
11-
author_date=old.authored_datetime,
12-
commit_date=old.committed_datetime
13-
)
14-
15-
md.update(kwargs)
16-
17-
returngit.Commit.create_from_tree(
18-
old.repo,old.tree,**md)
19-
20-
215
defreplace(commit,target=None,seen=None,**kwargs):
226
'''update commit <target>
237
@@ -35,14 +19,14 @@ def replace(commit, target=None, seen=None, **kwargs):
3519
seen.add(commit.hexsha)
3620

3721
ifcommit==target:
38-
new=clone_commit(commit,**kwargs)
22+
new=commit.replace(**kwargs)
3923
returnnew
4024

4125
parents=list(commit.parents)
4226
fori,parentinenumerate(parents):
4327
parents[i]=replace(parent,target=target,seen=seen,**kwargs)
4428

45-
returnclone_commit(commit,parent_commits=parents)
29+
returncommit.replace(parents=parents)
4630

4731

4832
@click.command()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp