@matheusbsbs / matheus-bagliano / commits / 8ead4fda3f
Fork 0

Create the origin based import branch using git update-ref instead of git branch so that it's possible to have the import branch in refs/remotes.

Create the origin based import branch using git update-ref instead of git branch so that it's possible to have the import branch in refs/remotes. Signed-off-by: Simon Hausmann <simon@lst.de>

Simon Hausmann committed May 17, 2007 at 20:26 UTC 8ead4fda3fbaba93aae46931285e9613a058c08b
1 file changed +4 -1
contrib/fast-import/git-p4
+4 -1
@@ -836,7 +836,10 @@ class P4Sync(Command):
836 if not gitBranchExists(self.branch) and gitBranchExists("origin"):
837 if not self.silent:
838 print "Creating %s branch in git repository based on origin" % self.branch
839 - system("git branch %s origin" % self.branch)
839 + branch = self.branch
840 + if not branch.startswith("refs"):
841 + branch = "refs/heads/" + branch
842 + system("git update-ref %s origin" % branch)
843
844 [self.previousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(self.branch))
845 if len(self.previousDepotPath) > 0 and len(p4Change) > 0: