Skip to content

Commit 592ec84

Browse files
committed
Fix rollback bug in SymbolicReference.set_reference
This fixes the initialization of the "ok" flag by setting it to False before the operation that might fail is attempted. (This is a fix for the *specific* problem reported in gitpython-developers#1669 about how the pattern SymbolicReference.set_reference attempts to use with LockedFD is not correctly implemented.)
1 parent a5a6464 commit 592ec84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: git/refs/symbolic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def set_reference(
370370

371371
lfd = LockedFD(fpath)
372372
fd = lfd.open(write=True, stream=True)
373-
ok = True
373+
ok = False
374374
try:
375375
fd.write(write_value.encode("utf-8") + b"\n")
376376
lfd.commit()

0 commit comments

Comments
 (0)