Skip to content

Commit

Permalink
Fix git symbolic-ref warning on initial clone
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
  • Loading branch information
Simon Hausmann committed May 21, 2007
1 parent dc52403 commit faf1bd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit faf1bd2

Please sign in to comment.