extensions/git/src/git.ts/Repository/getHEAD
class Repository:	async getHEAD(): Promise<Ref> {
		try {
			// Attempt to parse the HEAD file
			const result = await this.getHEADFS();
			return result;
		}
		catch (err) {
			this.logger.warn(err.message);
		}

		try {
			// Fallback to using git to determine HEAD
			const result = await this.exec(['symbolic-ref', '--short', 'HEAD']);

			if (!result.stdout) {
				throw new Error('Not in a branch');
			}

			return { name: result.stdout.trim(), commit: undefined, type: RefType.Head };
		}
		catch (err) { }

		// Detached HEAD
		const result = await this.exec(['rev-parse', 'HEAD']);

		if (!result.stdout) {
			throw new Error('Error parsing HEAD');
		}

		return { name: undefined, commit: result.stdout.trim(), type: RefType.Head };
	}