author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 24 Mar 2009 23:31:01 +0000 (16:31 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 25 Mar 2009 00:02:20 +0000 (17:02 -0700) | ||
commit | 3e262b95c50991de12cc5e180b72256561606a19 | |
tree | affb5e2c4e3fd692d75a999875fe7627a1b84feb | tree | snapshot |
parent | cbdffe4093be77bbb1408e54eead7865dd3bc33f | commit | diff |
Don't permit ref/branch names to end with ".lock"
We already skip over loose refs under $GIT_DIR/refs if the name
ends with ".lock", so creating a branch named "foo.lock" will not
appear in the output of "git branch", "git for-each-ref", nor will
its commit be considered reachable by "git rev-list --all".
In the latter case this is especially evil, as it may cause
repository corruption when objects reachable only through such a
ref are deleted by "git prune".
It should be reasonably safe to deny use of ".lock" as a ref suffix.
In prior versions of Git such branches would be "phantom branches";
you can create it, but you can't see it in "git branch" output.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We already skip over loose refs under $GIT_DIR/refs if the name
ends with ".lock", so creating a branch named "foo.lock" will not
appear in the output of "git branch", "git for-each-ref", nor will
its commit be considered reachable by "git rev-list --all".
In the latter case this is especially evil, as it may cause
repository corruption when objects reachable only through such a
ref are deleted by "git prune".
It should be reasonably safe to deny use of ".lock" as a ref suffix.
In prior versions of Git such branches would be "phantom branches";
you can create it, but you can't see it in "git branch" output.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-check-ref-format.txt | diff | blob | history | |
refs.c | diff | blob | history |