Commit Briefs

James Cook

Implement fast-forward merges.

Split part of got_worktree_merge_prepare into a new function, got_worktree_merge_write_refs, since that part doesn't make sense in the fast-forward case. ok stsp@


Stefan Sperling

make 'got tree /' succeed in a work tree

Previously, this command would trigger an error: got: /: bad path


Omar Polo

dropping unnecessary strlen()s

ok jamsek, stsp


Omar Polo

avoid strlen in for(;;)

ok jamsek, stsp


Omar Polo

got, tog: correctly skip HEAD in build_refs_str()

s[strlen(s)] == '\0' is banally always true, the intent was to not skip refs that starts with "HEAD". style nit / ok stsp@



Stefan Sperling

make 'got merge -c' fail even if new changes only affect unrelated paths

Otherwise, 'got merge -c' can silently revert already committed changes. Also fix GOT_ERR_MERGE_COMMIT_OUT_OF_DATE by giving it a value distinct from GOT_ERR_MERGE_STAGED_PATHS. Patch by James Cook


Stefan Sperling

make "got merge" refuse to run if a merge is in progress and the -a or

-c option wasn't passed. Patch by James Cook.


Stefan Sperling

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



Omar Polo

got: flush stdout before printing the error in main()

Since standard error is unbuffered, it could happen that the error string is printed immediately while the output from the subcommand is stuck in a buffer and written later. So flush() standard output before printing the error message. Problem reported by naddy@, ok stsp@


Omar Polo

consistently close the struct repository on every cmd_*()

Spotted while looking for leaks using Otto' malloc() new leaks detection. Harmless in practice since we just forgot to call got_repo_close() when terminating in some cmd_*() functions, but still a leak. ok stsp@


Omar Polo

fix crash in got log due to NULL-deref in got_object_blob_close

Reported by Mikhail (thanks!), ok jamsek


Todd C. Miller

Close the message template file before calling edit_logmsg().

Fixes a race condition on NFS where the file's modify time may change while the file is being edited, causing the editor to complain. OK stsp


Omar Polo

histedit_parse_list: avoid needless free(line)

getline(3) allows to safely re-use the storage. While here rename `size' to `linesize', `len' to `linelen', and properly initialize `linesize' to zero; suggested by tb@ ok tb@