Fix git symbolic-ref warning on initial clone
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Simon Hausmann committed
May 21, 2007 at 10:05 UTC
faf1bd202640263b06c99c335269971aa9d9ead1
1 file changed
+7
-1
contrib/fast-import/git-p4
+7
-1
@@ -732,6 +732,8 @@ class P4Sync(Command):
732
self.knownBranches = {}
733
self.initialParents = {}
734
735
+ createP4HeadRef = False;
736
+
737
if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists("refs/remotes/p4/master") and not self.detectBranches:
738
### needs to be ported to multi branch import
739
@@ -754,8 +756,9 @@ class P4Sync(Command):
756
if gitBranchExists("refs/heads/p4"):
757
system("git update-ref %s refs/heads/p4" % self.branch)
758
system("git branch -D p4");
759
+ # create it /after/ importing, when master exists
760
if not gitBranchExists("refs/remotes/p4/HEAD"):
758
- system("git symbolic-ref refs/remotes/p4/HEAD %s" % self.branch)
761
+ createP4HeadRef = True
762
763
# this needs to be called after the conversion from heads/p4 to remotes/p4/master
764
self.listExistingP4GitBranches()
@@ -1008,6 +1011,9 @@ class P4Sync(Command):
1011
self.gitOutput.close()
1012
self.gitError.close()
1013
1014
+ if createP4HeadRef:
1015
+ system("git symbolic-ref refs/remotes/p4/HEAD %s" % self.branch)
1016
+
1017
return True
1018
1019
class P4Rebase(Command):