author | Pierre Habouzit <madcoder@debian.org> | |
Wed, 7 Jul 2010 07:47:20 +0000 (09:47 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 7 Jul 2010 16:17:00 +0000 (09:17 -0700) | ||
commit | 765c22588d9e410bf0100c4991b1945134da6959 | |
tree | 3f86977024c13d2b94269974b9d077231586f38e | tree | snapshot |
parent | 420432d4342e214c15f063a630a883072d4e5779 | commit | diff |
fix git branch -m in presence of cross devices
When you have for example a bare repository stored on NFS, and that you
create new workdirs locally (using contrib's git-new-workdir), logs/refs
is a symlink to a different device. Hence when the reflogs are renamed,
all must happen below logs/refs or one gets cross device rename errors
like:
git branch -m foo
error: unable to move logfile logs/refs/heads/master to tmp-renamed-log: Invalid cross-device link
fatal: Branch rename failed
The fix is hence to use logs/refs/.tmp-renamed-log as a temporary log
name, instead of just tmp-renamed-log.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When you have for example a bare repository stored on NFS, and that you
create new workdirs locally (using contrib's git-new-workdir), logs/refs
is a symlink to a different device. Hence when the reflogs are renamed,
all must happen below logs/refs or one gets cross device rename errors
like:
git branch -m foo
error: unable to move logfile logs/refs/heads/master to tmp-renamed-log: Invalid cross-device link
fatal: Branch rename failed
The fix is hence to use logs/refs/.tmp-renamed-log as a temporary log
name, instead of just tmp-renamed-log.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c | diff | blob | history |