diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2011-10-11 14:25:32 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-11 13:46:20 -0700 |
commit | 3ac64370164fb80e92c3c9136210d3a49f1e01fa (patch) | |
tree | 41cc88a799c920e51cdeced8a5d07ce79a3dda60 /patch-ids.c | |
parent | Add test showing git-fetch groks gitfiles (diff) | |
download | tgif-3ac64370164fb80e92c3c9136210d3a49f1e01fa.tar.xz |
Fix is_gitfile() for files too small or larger than PATH_MAX to be a gitfile
The logic to check whether a file is a gitfile used the heuristics that
a gitfile cannot be larger than PATH_MAX or smaller than 10 bytes (as
its contents is "gitdir: " followed by a path) and returned early.
But it returned with a wrong value. It should have said "this cannot
possibly be a gitfile" by returning 0, but it returned 1 instead. Our
test cases do not cover this, as the bundle files produced are smaller
than PATH_MAX, except on Windows.
While at it, fix the faulty logic that the path stored in a gitfile cannot
be larger than PATH_MAX-sizeof("gitdir: ").
Problem identified by running the test suite in msysGit, offending commit
identified by Jörg Rosenkranz.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'patch-ids.c')
0 files changed, 0 insertions, 0 deletions