/**
 * In-process mutex for git operations so that only one git operation runs at a time
 * across both the UI (socket handlers) and Clark (git tool). Prevents overlapping
 * commits, pulls, etc.
 */
export function createGitOperationLock() {
    let held = false;
    return {
        tryAcquire() {
            if (held) {
                return { acquired: false };
            }
            held = true;
            return {
                acquired: true,
                release: () => {
                    held = false;
                },
            };
        },
    };
}
export const GIT_OPERATION_BUSY_MESSAGE = "Another git operation is in progress. Please wait for it to complete and try again.";
export const GIT_OPERATION_BUSY_MESSAGE_FOR_CLARK = "Git is currently in use (another operation is in progress, e.g. from the Versions panel). Please wait for it to complete and try again.";
//# sourceMappingURL=git-operation-lock.js.map