How to use the simple-git/src/git.trailingFunctionArgument function in simple-git

To help you get started, we’ve selected a few simple-git examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github materiahq / materia-server / src / lib / patches / git / ListLogSummary.js View on Github external
Git.prototype.log = function (options, then) {
	var handler = Git.trailingFunctionArgument(arguments);
	var opt = (handler === then ? options : null) || {};

	var splitter = opt.splitter || ';';
	var format = opt.format || {
		hash: '%H',
		date: '%ai',
		message: '%s%d',
		author_name: '%aN',
		author_email: '%ae'
	};
	var fields = Object.keys(format);
	var formatstr = fields.map(function(k) { return format[k]; }).join(splitter);
	var command = ["log", "--all", "--pretty=format:" + formatstr];

	if (Array.isArray(opt)) {
		command = command.concat(opt);