summaryrefslogtreecommitdiff
path: root/contrib/fast-import/git-p4
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-21 10:05:30 +0200
committerLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-21 10:05:30 +0200
commitfaf1bd202640263b06c99c335269971aa9d9ead1 (patch)
tree820235c8f4db29472339661c4fec9a6d6dca4000 /contrib/fast-import/git-p4
parentFix error detection with git-p4 submit when the requested depot path is not i... (diff)
downloadtgif-faf1bd202640263b06c99c335269971aa9d9ead1.tar.xz
Fix git symbolic-ref warning on initial clone
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Diffstat (limited to 'contrib/fast-import/git-p4')
-rwxr-xr-xcontrib/fast-import/git-p48
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 73da5d2b27..35a513fcb8 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -732,6 +732,8 @@ class P4Sync(Command):
self.knownBranches = {}
self.initialParents = {}
+ createP4HeadRef = False;
+
if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists("refs/remotes/p4/master") and not self.detectBranches:
### needs to be ported to multi branch import
@@ -754,8 +756,9 @@ class P4Sync(Command):
if gitBranchExists("refs/heads/p4"):
system("git update-ref %s refs/heads/p4" % self.branch)
system("git branch -D p4");
+ # create it /after/ importing, when master exists
if not gitBranchExists("refs/remotes/p4/HEAD"):
- system("git symbolic-ref refs/remotes/p4/HEAD %s" % self.branch)
+ createP4HeadRef = True
# this needs to be called after the conversion from heads/p4 to remotes/p4/master
self.listExistingP4GitBranches()
@@ -1008,6 +1011,9 @@ class P4Sync(Command):
self.gitOutput.close()
self.gitError.close()
+ if createP4HeadRef:
+ system("git symbolic-ref refs/remotes/p4/HEAD %s" % self.branch)
+
return True
class P4Rebase(Command):