@matheusbsbs / matheus-bagliano / commits / 05094f987c
Fork 0

Fix branch setup after initial clone.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>

Simon Hausmann committed May 18, 2007 at 20:32 UTC 05094f987c2f141ec9b873ad6d6303b0aca173a4
1 file changed +2 -7
contrib/fast-import/git-p4
+2 -7
@@ -828,8 +828,6 @@ class P4Sync(Command):
828 self.changeRange = ""
829 self.initialParent = ""
830 self.previousDepotPath = ""
831 - # importing into default remotes/p4/* layout?
832 - defaultImport = False
831
832 if self.syncWithOrigin and gitBranchExists("origin") and gitBranchExists("refs/remotes/p4/master"):
833 print "Syncing with origin first as requested by calling git fetch origin"
@@ -850,10 +848,9 @@ class P4Sync(Command):
848 self.branch = "refs/remotes/p4/master"
849 if gitBranchExists("refs/heads/p4"):
850 system("git update-ref %s refs/heads/p4" % self.branch)
853 - system("git symbolic-ref refs/remotes/p4/HEAD refs/remotes/p4/master")
851 system("git branch -D p4");
855 - else:
856 - defaultImport = True
852 + if not gitBranchExists("refs/remotes/p4/HEAD"):
853 + system("git symbolic-ref refs/remotes/p4/HEAD %s" % self.branch)
854
855 if len(args) == 0:
856 if not gitBranchExists(self.branch) and gitBranchExists("origin"):
@@ -863,8 +860,6 @@ class P4Sync(Command):
860 if not branch.startswith("refs"):
861 branch = "refs/heads/" + branch
862 system("git update-ref %s origin" % branch)
866 - if defaultImport:
867 - system("git symbolic-ref refs/remotes/p4/HEAD %s" % branch)
863
864 [self.previousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(self.branch))
865 if len(self.previousDepotPath) > 0 and len(p4Change) > 0: