Ignore .gitattributes in bare repositories
Attributes can be specified at three different places: the internal table of default values, the file $GIT_DIR/info/attributes and files named .gitattributes in the work tree. Since bare repositories don't have a work tree, git should ignore any .gitattributes files there. This patch makes git do that, so the only way left for a user to specify attributes in a bare repository is the file info/attributes (in addition to changing the defaults and recompiling). In addition, git-check-attr is now allowed to run without a work tree. Like any user of the code in attr.c, it ignores the .gitattributes files when run in a bare repository. It can still read from info/attributes. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
457bb45291
commit
2d35d556e2
2
git.c
2
git.c
@ -286,7 +286,7 @@ static void handle_internal_command(int argc, const char **argv)
|
||||
{ "checkout-index", cmd_checkout_index,
|
||||
RUN_SETUP | NEED_WORK_TREE},
|
||||
{ "check-ref-format", cmd_check_ref_format },
|
||||
{ "check-attr", cmd_check_attr, RUN_SETUP | NEED_WORK_TREE },
|
||||
{ "check-attr", cmd_check_attr, RUN_SETUP },
|
||||
{ "cherry", cmd_cherry, RUN_SETUP },
|
||||
{ "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE },
|
||||
{ "clone", cmd_clone },
|
||||
|
Reference in New Issue
Block a user