1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 04:16:10 +02:00

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>
This commit is contained in:
Simon Hausmann 2007-05-17 20:26:58 +02:00
parent 1c9d393d30
commit 8ead4fda3f

View File

@ -836,7 +836,10 @@ class P4Sync(Command):
if not gitBranchExists(self.branch) and gitBranchExists("origin"):
if not self.silent:
print "Creating %s branch in git repository based on origin" % self.branch
system("git branch %s origin" % self.branch)
branch = self.branch
if not branch.startswith("refs"):
branch = "refs/heads/" + branch
system("git update-ref %s origin" % branch)
[self.previousDepotPath, p4Change] = extractDepotPathAndChangeFromGitLog(extractLogMessageFromGitCommit(self.branch))
if len(self.previousDepotPath) > 0 and len(p4Change) > 0: