login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
git
»
2006
»
December
»
3
Re: [PATCH] git-mv: search more precisely for source directory in index
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Sergey Vlasov
Subject:
Re: [PATCH] git-mv: search more precisely for source directory in index
Date: Sunday, December 3, 2006 - 1:04 pm
On Sun, Dec 03, 2006 at 08:42:47PM +0100, Johannes Schindelin wrote:
quoted text
>=20 > A move of a directory should find the entries in the index by > searching for the name _including_ the slash. Otherwise, the > directory can be shadowed by a file when it matches the prefix > and is lexicographically smaller, e.g. "ab.c" shadows "ab/".
Thanks - seems to work now, and the existing tests are not broken.
quoted text
> Noticed by Sergey Vlasov. >=20 > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> > --- >=20 > Good catch. Thanks! >=20 > builtin-mv.c | 11 +++++++---- > 1 files changed, 7 insertions(+), 4 deletions(-) >=20 > diff --git a/builtin-mv.c b/builtin-mv.c > index 54dd3bf..d14a4a7 100644 > --- a/builtin-mv.c > +++ b/builtin-mv.c > @@ -146,21 +146,24 @@ int cmd_mv(int argc, const char **argv, const char =
*prefix)
quoted text
> && lstat(dst, &st) =3D=3D 0) > bad =3D "cannot move directory over file"; > else if (src_is_dir) { > + const char *src_w_slash =3D add_slash(src); > + int len_w_slash =3D length + 1; > int first, last; > =20 > modes[i] =3D WORKING_DIRECTORY; > =20 > - first =3D cache_name_pos(src, length); > + first =3D cache_name_pos(src_w_slash, len_w_slash); > if (first >=3D 0) > - die ("Huh? %s/ is in index?", src); > + die ("Huh? %.*s is in index?", > + len_w_slash, src_w_slash); > =20 > first =3D -1 - first; > for (last =3D first; last < active_nr; last++) { > const char *path =3D active_cache[last]->name; > - if (strncmp(path, src, length) > - || path[length] !=3D '/') > + if (strncmp(path, src_w_slash, len_w_slash)) > break; > } > + free((char *)src_w_slash); > =20 > if (last - first < 1) > bad =3D "source directory is empty";
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[BUG] git-mv fails with "source directory is empty" when i ...
, Sergey Vlasov
, (Sun Dec 3, 6:57 am)
[PATCH] git-mv: search more precisely for source directory ...
, Johannes Schindelin
, (Sun Dec 3, 12:42 pm)
Re: [PATCH] git-mv: search more precisely for source direc ...
, Sergey Vlasov
, (Sun Dec 3, 1:04 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [patch] e1000=y && e1000e=m regression fix
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
Boaz Harrosh
how to use KBUILD_EXTRA_SYMBOLS
Brandeburg, Jesse
RE: [regression] e1000e broke e1000 (was: Re: [ANNOUNCE] e1000 toe1000e migration ...
Pekka Enberg
Re: [PATCH] include/linux/slab.h: new KFREE() macro.
git
:
Bill Lear
cpio command not found
Jing Xue
Re: git rm --cached
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Johannes Schindelin
Re: [PATCH 1/3 v2] Implement the patience diff algorithm
Johannes Sixt
Re: How to pull remote branch with specified commit id?
linux-netdev
:
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Oliver Neukum
Re: [RFC] Patch to option HSO driver to the kernel
Paulius Zaleckas
Re: [RFC] Patch to option HSO driver to the kernel
Timo Teräs
ip xfrm policy semantics
Ron Mercer
[net-next PATCH 2/2] qlge: Version change to v1.00.00.27
openbsd-misc
:
Tomas Bodzar
Re: OpenSMTPd actual development and integration
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Bryan Irvine
Re: DVD burn error: No space left on device
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Siju George
This is what Linus Torvalds calls openBSD crowd
git-commits-head
:
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
[ARM] mmp: avengers lite (pxa168) board bring up
Linux Kernel Mailing List
via82cxxx: add support for VT6415 PCIE PATA IDE Host Controller
Linux Kernel Mailing List
checkpatch: warn on declaration with storage class not at the beginning
Linux Kernel Mailing List
USB: remove duplicate entry in Option driver and Pl2303 driver for Huawei modem
Colocation donated by:
Syndicate