When we create a cheap local clone by pointing at the object databse
of the original repository, we forgot to take the alternates the original
repository might have had into account.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Using the $GIT_OBJECT_DIRECTORY/info/alternates mechanism,
create a new repository that borrows objects from the original
repository when --shared flag is given in addition to --local.
It is worth pointing out that the "cloned" repository depends on
the original repository, so this should be used only when you
can reasonably trust that the original repository would not
disappear without your knowing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Using the information prepared with update-server-info, a truly
dumb http server can allow cloning with this client side
support.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
A bit more usability enhancement, while retaining Cogito
compatibility (and fixing the "-u" flag).
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
While adding the documentation for these two commands, I noticed
that the name of the program on the other end (git-upload-pack)
is already almost configurable but git-clone-pack lacked command
line parameter parsing to actually use anything but default, so
I introduced --exec= like other remote commands while I was at it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- When local optimization is used, the variable repo has
already been passed through get_repo_base so there is no need
to check for .git subdirectory in there.
- Use cpio -l instead of "cp -l".
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This silently adds the ".git" directory component if needed, so you
don't need to state it explicitly for the source. Also, it turns the
source into an absolute pathname when local, so that you can use
relative pathnames without losing sight of the source when we cd into
the destination.
When we are cloning a repository on a local filesystem, it is
faster to just create a hard linkfarm of .git/object hierarchy
and copy the .git/refs files. By default, the script uses the
clone-pack method, but it can be told with the -l flag to do the
hard linkfarm (falling back on recursive file copy) to replicate
the .git/object hierarchy.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>