import { log } from "../log.js";
import { getMatches } from "../file-matching.js";
import { defineSource } from "../source.js";
import { readGitConfig } from "pkg-types";
//#region src/lib/sources/git-config.ts
const gitConfigSource = defineSource({
	async discover(context) {
		return getMatches(context.options, [".git/config"]);
	},
	key: "gitConfig",
	async parse(input) {
		log.debug("Extracting git config metadata...");
		return {
			data: { ...await readGitConfig(input) },
			source: input
		};
	},
	phase: 1
});
//#endregion
export { gitConfigSource };
