author | Andreas Färber <andreas.faerber@web.de> | |
Mon, 25 Aug 2008 15:33:03 +0000 (17:33 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 26 Aug 2008 06:14:39 +0000 (23:14 -0700) | ||
commit | 3e073dc561185d5ad2325cb012943020e068801e | |
tree | 473717ac8c54de9caa939f7fa2f8ef10ca4beb69 | tree | snapshot |
parent | 5760a6b094736e6f59eb32c7abb4cdbb7fca1627 | commit | diff |
Makefile: always provide a fallback when hardlinks fail
We make hardlinks from "git" to "git-<cmd>" built-ins and have been
careful to avoid cross-device links when linking "git-<cmd>" to
gitexecdir.
However, we were not prepared to deal with a build directory that is
incapable of making hard links within itself. This patch corrects it.
Instead of temporarily linking "git" to gitexecdir, directly link "git-
add", falling back to "cp". Try hardlinking that as "git-<cmd>", falling
back to symlinks or "cp" on error.
While at it, avoid 100+ error messages from hardlink failures when we are
going to fall back to symlinks or "cp" by redirecting the standard error
to /dev/null.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We make hardlinks from "git" to "git-<cmd>" built-ins and have been
careful to avoid cross-device links when linking "git-<cmd>" to
gitexecdir.
However, we were not prepared to deal with a build directory that is
incapable of making hard links within itself. This patch corrects it.
Instead of temporarily linking "git" to gitexecdir, directly link "git-
add", falling back to "cp". Try hardlinking that as "git-<cmd>", falling
back to symlinks or "cp" on error.
While at it, avoid 100+ error messages from hardlink failures when we are
going to fall back to symlinks or "cp" by redirecting the standard error
to /dev/null.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | diff | blob | history |