"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveInitTargetCwd = resolveInitTargetCwd;
exports.validateTargetedInitOptions = validateTargetedInitOptions;
exports.isTargetedGiteaInit = isTargetedGiteaInit;
exports.validateTargetedGiteaProjectRefs = validateTargetedGiteaProjectRefs;
exports.validateTargetedGiteaServiceOptions = validateTargetedGiteaServiceOptions;
const node_path_1 = __importDefault(require("node:path"));
const repository_setup_1 = require("../../git/repository-setup");
async function resolveInitTargetCwd(cwd, options) {
    const targetCwd = node_path_1.default.resolve(cwd, options.cwd ?? ".");
    if (!isTargetedGiteaInit(options)) {
        return targetCwd;
    }
    return (await (0, repository_setup_1.discoverContainingGitRoot)(targetCwd)) ?? targetCwd;
}
function validateTargetedInitOptions(options) {
    void options;
}
function isTargetedGiteaInit(options) {
    return options.createRepo === true;
}
function validateTargetedGiteaProjectRefs(options) {
    void options;
}
function validateTargetedGiteaServiceOptions(options) {
    void options;
}
