From 7eff28a9b42cb0d3aad932338b2e645fc6ed8fa9 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 30 Dec 2006 23:32:38 -0500 Subject: Disallow working directory commands in a bare repository. If the user tries to run a porcelainish command which requires a working directory in a bare repository they may get unexpected results which are difficult to predict and may differ from command to command. Instead we should detect that the current repository is a bare repository and refuse to run the command there, as there is no working directory associated with it. [jc: updated Shawn's original somewhat -- bugs are mine.] Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- git-commit.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'git-commit.sh') diff --git a/git-commit.sh b/git-commit.sh index 04aad5e5da..557b90355c 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -6,6 +6,7 @@ USAGE='[-a] [-s] [-v] [--no-verify] [-m | -F | (-C|-c) ] [-u] [--amend] [-e] [--author ] [[-i | -o] ...]' SUBDIRECTORY_OK=Yes . git-sh-setup +require_work_tree git-rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t -- cgit v1.2.3