Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'remote-testsvn.c')
-rw-r--r--remote-testsvn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/remote-testsvn.c b/remote-testsvn.c
index 3af708c5b6..cde39b94fb 100644
--- a/remote-testsvn.c
+++ b/remote-testsvn.c
@@ -13,7 +13,7 @@
static const char *url;
static int dump_from_file;
static const char *private_ref;
-static const char *remote_ref = "refs/heads/master";
+static char *remote_ref;
static const char *marksfilename, *notes_ref;
struct rev_note { unsigned int rev_nr; };
@@ -286,7 +286,7 @@ int cmd_main(int argc, const char **argv)
private_ref_sb = STRBUF_INIT, marksfilename_sb = STRBUF_INIT,
notes_ref_sb = STRBUF_INIT;
static struct remote *remote;
- const char *url_in;
+ const char *url_in, *remote_ref_short;
setup_git_directory();
if (argc < 2 || argc > 3) {
@@ -294,6 +294,9 @@ int cmd_main(int argc, const char **argv)
return 1;
}
+ remote_ref_short = git_default_branch_name();
+ remote_ref = xstrfmt("refs/heads/%s", remote_ref_short);
+
remote = remote_get(argv[1]);
url_in = (argc == 3) ? argv[2] : remote->url[0];
@@ -306,7 +309,8 @@ int cmd_main(int argc, const char **argv)
url = url_sb.buf;
}
- strbuf_addf(&private_ref_sb, "refs/svn/%s/master", remote->name);
+ strbuf_addf(&private_ref_sb, "refs/svn/%s/%s",
+ remote->name, remote_ref_short);
private_ref = private_ref_sb.buf;
strbuf_addf(&notes_ref_sb, "refs/notes/%s/revs", remote->name);