summaryrefslogtreecommitdiff
path: root/contrib/git-svn
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-03-03 09:20:09 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-03 19:27:25 (GMT)
commit7f60b228601becaa0bca2017521e1f27d5af70b1 (patch)
tree6c0f226bbabe93cdef546736b821c3d1e1d875b3 /contrib/git-svn
parenteeb0abe0477dd638f52ef82795338edcb49efa2f (diff)
downloadgit-7f60b228601becaa0bca2017521e1f27d5af70b1.zip
git-7f60b228601becaa0bca2017521e1f27d5af70b1.tar.gz
git-7f60b228601becaa0bca2017521e1f27d5af70b1.tar.bz2
contrib/git-svn: create a more recent master if one does not exist
In a new repository, the initial fetch creates a master branch if one does not exist so HEAD has something to point to. It now creates a master at the end of the initial fetch run, pointing to the latest revision. Previously it pointed to the first revision imported, which is generally less useful. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'contrib/git-svn')
-rwxr-xr-xcontrib/git-svn/git-svn.perl6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 5d547e8..69b6be3 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -224,9 +224,6 @@ sub fetch {
sys(@svn_co, $SVN_URL, $SVN_WC);
chdir $SVN_WC or croak $!;
$last_commit = git_commit($base, @parents);
- unless (-f "$GIT_DIR/refs/heads/master") {
- sys(qw(git-update-ref refs/heads/master),$last_commit);
- }
assert_svn_wc_clean($base->{revision}, $last_commit);
} else {
chdir $SVN_WC or croak $!;
@@ -242,6 +239,9 @@ sub fetch {
$last_commit = git_commit($log_msg, $last_commit, @parents);
}
assert_svn_wc_clean($last_rev, $last_commit);
+ unless (-e "$GIT_DIR/refs/heads/master") {
+ sys(qw(git-update-ref refs/heads/master),$last_commit);
+ }
return pop @$svn_log;
}