Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Keep path references in merge_file_from_index #520
+6
−3
Conversation
|
The single-line expression works fine for the simpler expression, but once we're getting into tuples and negations, it would look a lot more readable if we had a function which had the logic instead of copying on each line, something like def entry_to_maybe_c(entry):
if entry is None:
return ffi.NULL, ffi.NULL
return entry._to_c() |
jdavid
merged commit efb49f8
into
libgit2:master
May 3, 2015
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cjwatson commentedApr 23, 2015
IndexEntry._to_c requires its caller to hold a reference to the path it
returns until it no longer needs the C structure.
Repository.merge_file_from_index was not doing so, causing the merge
text to contain garbage from freed memory in some cases.