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

Commite0eafc4

Browse files
committed
Fix corruption of the ref logs file
It must only have the first line of thecommit messages, not the while multiple line log.
1 parentd5739cd commite0eafc4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎git/refs/log.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def from_line(cls, line):
114114
newhexsha=info[41:81]
115115
forhexshain (oldhexsha,newhexsha):
116116
ifnotcls._re_hexsha_only.match(hexsha):
117-
raiseValueError("Invalid hexsha: %s"%hexsha)
117+
raiseValueError("Invalid hexsha: %r"%(hexsha,))
118118
# END if hexsha re doesn't match
119119
# END for each hexsha
120120

@@ -274,11 +274,12 @@ def append_entry(cls, config_reader, filepath, oldbinsha, newbinsha, message):
274274
raiseValueError("Shas need to be given in binary format")
275275
# END handle sha type
276276
assure_directory_exists(filepath,is_file=True)
277+
first_line=message.split('\n')[0]
277278
committer=isinstance(config_reader,Actor)andconfig_readerorActor.committer(config_reader)
278279
entry=RefLogEntry((
279280
bin_to_hex(oldbinsha).decode('ascii'),
280281
bin_to_hex(newbinsha).decode('ascii'),
281-
committer, (int(time.time()),time.altzone),message
282+
committer, (int(time.time()),time.altzone),first_line
282283
))
283284

284285
lf=LockFile(filepath)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp