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 <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
4b441f47ce
commit
7eff28a9b4
@ -8,6 +8,7 @@ USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <rep
|
||||
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
|
||||
. git-sh-setup
|
||||
set_reflog_action "pull $*"
|
||||
require_work_tree
|
||||
|
||||
test -z "$(git ls-files -u)" ||
|
||||
die "You are in a middle of conflicted merge."
|
||||
|
Reference in New Issue
Block a user