aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-fetch.sh1
-rw-r--r--server-info.c7
-rw-r--r--upload-pack.c8
3 files changed, 16 insertions, 0 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index 7c05880bc..0cb1596f5 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -176,6 +176,7 @@ if test "$tags"
then
taglist=$(git-ls-remote --tags "$remote" |
sed -e '
+ /\^{}$/d
s/^[^ ]* //
s/.*/&:&/')
if test "$#" -gt 1
diff --git a/server-info.c b/server-info.c
index 3c08a288d..ba5359108 100644
--- a/server-info.c
+++ b/server-info.c
@@ -9,7 +9,14 @@ static FILE *info_ref_fp;
static int add_info_ref(const char *path, const unsigned char *sha1)
{
+ struct object *o = parse_object(sha1);
+
fprintf(info_ref_fp, "%s %s\n", sha1_to_hex(sha1), path);
+ if (o->type == tag_type) {
+ o = deref_tag(o);
+ fprintf(info_ref_fp, "%s %s^{}\n",
+ sha1_to_hex(o->sha1), path);
+ }
return 0;
}
diff --git a/upload-pack.c b/upload-pack.c
index 83f5a35d2..21b4b8b75 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1,6 +1,8 @@
#include "cache.h"
#include "refs.h"
#include "pkt-line.h"
+#include "tag.h"
+#include "object.h"
static const char upload_pack_usage[] = "git-upload-pack <dir>";
@@ -165,7 +167,13 @@ static int receive_needs(void)
static int send_ref(const char *refname, const unsigned char *sha1)
{
+ struct object *o = parse_object(sha1);
+
packet_write(1, "%s %s\n", sha1_to_hex(sha1), refname);
+ if (o->type == tag_type) {
+ o = deref_tag(o);
+ packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
+ }
return 0;
}