diff options
author | Clemens Buchacher <drizzd@aon.at> | 2012-04-13 01:11:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-15 13:28:02 -0700 |
commit | 2565b43bd2634ffd6bda06236d664288aeb8eb6a (patch) | |
tree | c7f09bea843450064e21caa3ff5906c20af12629 /t/Makefile | |
parent | Git 1.7.10 (diff) | |
download | tgif-2565b43bd2634ffd6bda06236d664288aeb8eb6a.tar.xz |
properly keep track of current working directory
Various failure modes in the repository detection code path currently
quote the wrong directory in their error message. The working directory
is changed iteratively to the parent directory until a git repository is
found. If the working directory cannot be changed to the parent
directory for some reason, the detection gives up and prints an error
message. The error message should report the current working directory.
Instead of continually updating the 'cwd' variable, which is actually
used to remember the original working directory, the 'offset' variable
is used to keep track of the current working directory. At the point
where the affected error handling code is called, 'offset' already
points to the end of the parent of the working directory, rather than
the current working directory.
Fix this by explicitly using a variable 'offset_parent' and update
'offset' concurrently with the call to chdir.
In a similar fashion, the function get_device_or_die() would print the
original working directory in case of a failure, rather than the current
working directory. Fix this as well by making use of the 'offset'
variable.
Lastly, replace the phrase 'mount parent' with 'mount point'. The former
appears to be a typo.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/Makefile')
0 files changed, 0 insertions, 0 deletions