]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
fix git branch -m in presence of cross devices
authorPierre Habouzit <madcoder@debian.org>
Wed, 7 Jul 2010 07:47:20 +0000 (09:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Jul 2010 16:17:00 +0000 (09:17 -0700)
commit765c22588d9e410bf0100c4991b1945134da6959
tree3f86977024c13d2b94269974b9d077231586f38e
parent420432d4342e214c15f063a630a883072d4e5779
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>
refs.c