Commit Briefs
special case 'got fetch -b <branch>' to only fetch <branch>
As discussed on irc, this drops the implicit remote HEAD fetch when -b is used. got.1 has been updated to make the new fetch behaviour clear. ok stsp@
got: use intermediate pointers to plug leak on realloc
And save worktree_branch_len for reuse. ok stsp@ and op@
fix interaction of 'got fetch -b', got.conf, and work tree
Without branches in got.conf for a remote, and without -b/-R options, the fallback to HEAD would only work when not invoked in a work tree. With this fix 'got fetch' should behave as described in the man page. The -b option now overrides both got.conf and the fallback to the work tree's branch. And fallback to HEAD works as expected when invoked in a repository. Also, do not strictly require remote repositories to provide a branch from the refs/heads/ namespace. In such cases users should be able to use -R to select something to fetch. ok jamsek
got: minor refactor of got_pathlist_free() API
Accept flag parameter to optionally specify which pointers to free. This saves callers looping through the list to free pointers. ok + fix stsp@
fix uninitialised fildes variables in libexec helpers
Reviewed and uncovered as part of the diff in the forthcoming commit (pathlist API refactor). ok stsp@
fix snprintf error handling
follow the "proper secure idiom" described in the CAVEATS section of printf(3). reminded by tb@ and millert@
convert two snprintf to strlcpy
"looks good to me" millert@