Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  git-svn: make rebuild respect rewriteRoot option
  Workaround for AIX mkstemp()
  • Loading branch information
Junio C Hamano committed Jun 24, 2008
2 parents f2ab7f8 + 74b1e12 commit 6b516d9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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>) {
Expand All @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 32 additions & 0 deletions t/t9123-git-svn-rebuild-with-rewriteroot.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6b516d9

Please sign in to comment.