summaryrefslogtreecommitdiff
path: root/include/git2/patch.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-04-09 14:08:22 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-04-30 00:41:37 +0200
commit217c029b54e8f1574ae6bc71c4b25533ecff3b6a (patch)
treef8caf68f1027883b5370e057b29946433d100dd8 /include/git2/patch.h
parent041336e6bd9dbd22db29f2294e5db8645efdd46b (diff)
downloadlibgit2-cmn/commit-create-safe.tar.gz
commit: safer commit creation with reference updatecmn/commit-create-safe
The current version of the commit creation and amend function are unsafe to use when passing the update_ref parameter, as they do not check that the reference at the moment of update points to what the user expects. Make sure that we're moving history forward when we ask the library to update the reference for us by checking that the first parent of the new commit is the current value of the reference. We also make sure that the ref we're updating hasn't moved between the read and the write. Similarly, when amending a commit, make sure that the current tip of the branch is the commit we're amending.
Diffstat (limited to 'include/git2/patch.h')
0 files changed, 0 insertions, 0 deletions