◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
5 changes: 3 additions & 2 deletions git/refs/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def from_line(cls, line):
newhexsha = info[41:81]
for hexsha in (oldhexsha, newhexsha):
if not cls._re_hexsha_only.match(hexsha):
raise ValueError("Invalid hexsha: %s" % hexsha)
# END if hexsha re doesn't match
# END for each hexsha

Expand Up @@ -274,11 +274,12 @@ 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)
committer = isinstance(config_reader, Actor) and config_reader or Actor.committer(config_reader)
entry = RefLogEntry((
bin_to_hex(oldbinsha).decode('ascii'),
bin_to_hex(newbinsha).decode('ascii'),
committer, (int(time.time()), time.altzone), message
))

lf = LockFile(filepath)
Expand Down
13 changes: 12 additions & 1 deletion git/test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,23 @@ def test_empty_repo(self, rw_dir):
new_file_path = os.path.join(rw_dir, "new_file.ext")
touch(new_file_path)
r.index.add([new_file_path])
r.index.commit("initial commit")

# Now a branch should be creatable
nb = r.create_head('foo')
assert nb.is_valid()

def test_merge_base(self):
repo = self.rorepo
c1 = 'f6aa8d1'
Toggle all file notes Toggle all file annotations