diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-06-23 17:52:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-23 17:52:02 -0700 |
commit | 6b516d984bc72b359a14eeddfddca578cef52297 (patch) | |
tree | ca63e5f4932f1a5cefcdae27d829f3dc0ff5a383 | |
parent | f2ab7f82b7bd8f0147f656e7d279236d1bd68921 (diff) | |
parent | 74b1e1235781bbe5c90b802c1551446a5f5d69f1 (diff) | |
download | git-6b516d984bc72b359a14eeddfddca578cef52297.tar.gz |
Merge branch 'maint'
* maint:
git-svn: make rebuild respect rewriteRoot option
Workaround for AIX mkstemp()
-rwxr-xr-x | git-svn.perl | 6 | ||||
-rw-r--r-- | sha1_file.c | 1 | ||||
-rwxr-xr-x | t/t9123-git-svn-rebuild-with-rewriteroot.sh | 32 |
3 files changed, 36 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl index a54979dc51..4c9c59bc3f 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2577,8 +2577,8 @@ sub rebuild { my ($log, $ctx) = command_output_pipe(qw/rev-list --pretty=raw --no-color --reverse/, $self->refname, '--'); - my $full_url = $self->full_url; - remove_username($full_url); + my $metadata_url = $self->metadata_url; + remove_username($metadata_url); my $svn_uuid = $self->ra_uuid; my $c; while (<$log>) { @@ -2596,7 +2596,7 @@ sub rebuild { # if we merged or otherwise started elsewhere, this is # how we break out of it if (($uuid ne $svn_uuid) || - ($full_url && $url && ($url ne $full_url))) { + ($metadata_url && $url && ($url ne $metadata_url))) { next; } diff --git a/sha1_file.c b/sha1_file.c index 191f814e09..92299ed622 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -2118,6 +2118,7 @@ static int create_tmpfile(char *buffer, size_t bufsiz, const char *filename) fd = mkstemp(buffer); if (fd < 0 && dirlen) { /* Make sure the directory exists */ + memcpy(buffer, filename, dirlen); buffer[dirlen-1] = 0; if (mkdir(buffer, 0777) || adjust_shared_perm(buffer)) return -1; diff --git a/t/t9123-git-svn-rebuild-with-rewriteroot.sh b/t/t9123-git-svn-rebuild-with-rewriteroot.sh new file mode 100755 index 0000000000..c18878fad1 --- /dev/null +++ b/t/t9123-git-svn-rebuild-with-rewriteroot.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Copyright (c) 2008 Jan Krüger +# + +test_description='git-svn respects rewriteRoot during rebuild' + +. ./lib-git-svn.sh + +mkdir import +cd import + touch foo + svn import -m 'import for git-svn' . "$svnrepo" >/dev/null +cd .. +rm -rf import + +test_expect_success 'init, fetch and checkout repository' ' + git svn init --rewrite-root=http://invalid.invalid/ "$svnrepo" && + git svn fetch + git checkout -b mybranch remotes/git-svn + ' + +test_expect_success 'remove rev_map' ' + rm "$GIT_SVN_DIR"/.rev_map.* + ' + +test_expect_success 'rebuild rev_map' ' + git svn rebase >/dev/null + ' + +test_done + |