summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 294c695)
raw | patch | inline | side by side (parent: 294c695)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Dec 2005 05:25:22 +0000 (21:25 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Dec 2005 05:25:22 +0000 (21:25 -0800) |
clone-pack had some logic to accept subset of remote refs from
the command line and clone from there. However, it was never
used in practice and its problems were not found out so far.
This commit changes the command to output the object names of
refs to the standard output instead of making a clone of the
remote repository when explicit <head> parameters are given; the
output format is the same as fetch-pack.
The traditional behaviour of cloning the whole repository by
giving no explicit <head> parameters stays the same.
Signed-off-by: Junio C Hamano <junkio@cox.net>
the command line and clone from there. However, it was never
used in practice and its problems were not found out so far.
This commit changes the command to output the object names of
refs to the standard output instead of making a clone of the
remote repository when explicit <head> parameters are given; the
output format is the same as fetch-pack.
The traditional behaviour of cloning the whole repository by
giving no explicit <head> parameters stays the same.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-clone-pack.txt | patch | blob | history | |
clone-pack.c | patch | blob | history |
index cfc7b62f31b6470b9d9011b49d73d135a0623dd9..39906fc450150ee0e9213a31c8a7c3e50d01b5b3 100644 (file)
The heads to update. This is relative to $GIT_DIR
(e.g. "HEAD", "refs/heads/master"). When unspecified,
all heads are updated to match the remote repository.
-
++
+Usually all the refs from existing repository are stored
+under the same name in the new repository. Giving explicit
+<head> arguments instead writes the object names and refs to
+the standard output, just like get-fetch-pack does.
Author
------
diff --git a/clone-pack.c b/clone-pack.c
index a99a95c5f26718bd509a1c8906663fd73447f16d..b5ce5d3111521427cffb8cf72c6acf31340255d9 100644 (file)
--- a/clone-pack.c
+++ b/clone-pack.c
status = clone_without_unpack(fd);
- if (!status)
- write_refs(refs);
+ if (!status) {
+ if (nr_match == 0)
+ write_refs(refs);
+ else
+ while (refs) {
+ printf("%s %s\n",
+ sha1_to_hex(refs->old_sha1),
+ refs->name);
+ refs = refs->next;
+ }
+ }
return status;
}