summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-clone-pack.txt6
-rw-r--r--clone-pack.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/Documentation/git-clone-pack.txt b/Documentation/git-clone-pack.txt
index cfc7b62f31..39906fc450 100644
--- a/Documentation/git-clone-pack.txt
+++ b/Documentation/git-clone-pack.txt
@@ -43,7 +43,11 @@ OPTIONS
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 a99a95c5f2..b5ce5d3111 100644
--- a/clone-pack.c
+++ b/clone-pack.c
@@ -259,8 +259,17 @@ static int clone_pack(int fd[2], int nr_match, char **match)
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;
}