Commit Briefs

a4c8ed779e Thomas Adam

simplify ancestry checks in checkout, update, rebase, and merge

No behaviour change as the end result of the rewritten checks should be the same as before. We are just doing less work where possible. Patch by James Cook


98670ba726 Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


4680f70435 Thomas Adam

portable: remove sha1.h; found portably

Remove sha1.h as this is found portably across systems.


588a8092bc Thomas Adam

include sha2.h too where sha1.h is included

In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


7210b7156b Thomas Adam

make got_commit_graph_iter_next use caller-provided storage for the id

and adjust the callers. discussed with and ok stsp@


d68b973725 Thomas Adam

plug leak in the commit graph iterator

We fail to release the memory for the nodes. To fix it however, we some consumer of the commit graph iterator need to be corrected: the returned pointer is safe to be used only up until the next iter_next call; save a copy it if it's needed afterwards too. ok stsp@


99c6f580a3 Thomas Adam

replace an indirect call to idset_add(), via add_node(), with a direct call

Avoids leaking the node structure returned from add_node(). ok op@


07894e99b1 Thomas Adam

free commit on error path

while here drop the ternary too: if add_node succeeds `new_node' is non-NULL. ok stsp@


f3933be66b Thomas Adam

plug leak: release nodes not added to the iter list

ok stsp@


599785e85d Thomas Adam

got_commit_graph_close: free tailq contents

The tailq should ideally be empty when we reach got_commit_graph_close, but consumer code may exit the commit graph loop earlier. spotted by and ok stsp@


8b925c6ccd Thomas Adam

portable: add back sys/queue.h

Now that the handling of including sys/queue.h is better, there's no need to remove those lines from the source. Copy the location of those original sys/queue.h lines from upstream at the same line number, so as to avoid any conflicts in the future.


ec242592d3 Thomas Adam

inline struct got_object_id in struct got_object_qid

Saves us from doing a malloc/free call for every item on the list. ok op@


945f922947 Thomas Adam

stop relying on commit cache for good performance of got_object_id_by_path()

Instead of internally opening and closing the same commit object over and over again, require callers to pass an open commit object in. Avoids an inherent dependency on the commit object cache for reasonable performance. ok op@



92a9e85d28 Thomas Adam

portable: add FreeBSD support

This adds the capability to compile got-portable on FreeBSD.


dd038bc6ec Thomas Adam

portable: initial Linux compilation

This commit modifies the GoT main branch to be able to compile it under linux.


dbdddfee14 Christian Weisgerber

switch from SIMPLEQ to equivalent STAILQ macros

The singly-linked tail queue macros were added to OpenBSD 6.9 and are more widely available on other systems. ok stsp



5aa813935b Stefan Sperling

add copyright year for files already touched in 2020



e7a5b9e9b7 Stefan Sperling

commit graph's close_branch() can be inlined in one place


df8cd9c6cd Stefan Sperling

small simplification in got_commit_graph_iter_next()


a450c2bf91 Stefan Sperling

remove a misleading comment


48595de13a Stefan Sperling

remove redundant code from add_node_to_iter_list()