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

Commit1b6b951

Browse files
committed
Fixed bug that would cause the author's email to be a generic default one, instead of the existing and valid. The rest of the ConfigParser handling is correct, as it reads all configuration files available to git
seehttp://github.com/Byron/GitPython/issues#issue/1
1 parent2c0b92e commit1b6b951

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎lib/git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(self, file_or_files, read_only=True):
136136
# initialize lock base - we want to write
137137
self._lock=self.t_lock(file_or_files)
138138

139-
self._lock._obtain_lock()
139+
self._lock._obtain_lock()
140140
# END read-only check
141141

142142

‎lib/git/objects/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
5252
env_email="EMAIL"
5353

5454
# CONFIGURATION KEYS
55-
conf_email='email'
5655
conf_name='name'
56+
conf_email='email'
5757
conf_encoding='i18n.commitencoding'
5858

5959
# INVARIANTS
@@ -294,7 +294,7 @@ def create_from_tree(cls, repo, tree, message, parent_commits=None, head=False):
294294
conf_email=cr.get_value('user',cls.conf_email,default_email)
295295

296296
author_name=env.get(cls.env_author_name,conf_name)
297-
author_email=env.get(cls.env_author_email,default_email)
297+
author_email=env.get(cls.env_author_email,conf_email)
298298

299299
committer_name=env.get(cls.env_committer_name,conf_name)
300300
committer_email=env.get(cls.env_committer_email,conf_email)

‎test/git/test_index.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ def test_index_mutation(self, rw_repo):
353353
num_entries=len(index.entries)
354354
cur_head=rw_repo.head
355355

356+
uname="Some Developer"
357+
umail="sd@company.com"
358+
rw_repo.config_writer().set_value("user","name",uname)
359+
rw_repo.config_writer().set_value("user","email",umail)
360+
356361
# remove all of the files, provide a wild mix of paths, BaseIndexEntries,
357362
# IndexEntries
358363
defmixed_iterator():
@@ -404,6 +409,10 @@ def mixed_iterator():
404409
commit_message="commit default head"
405410

406411
new_commit=index.commit(commit_message,head=False)
412+
assertnew_commit.author.name==uname
413+
assertnew_commit.author.email==umail
414+
assertnew_commit.committer.name==uname
415+
assertnew_commit.committer.email==umail
407416
assertnew_commit.message==commit_message
408417
assertnew_commit.parents[0]==cur_commit
409418
assertlen(new_commit.parents)==1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp