@matheusbsbs / matheus-bagliano / commits / 0058a33a8e
Fork 0

git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when running git-p4 sync the first time after a git clone.

Don't create the p4/HEAD symbolic ref if p4/master doesn't exist yet. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Simon Hausmann committed Aug 24, 2007 at 17:46 UTC 0058a33a8eb5a8bfcfc5f5e769a2517cff4b73f1
1 file changed +1 -1
contrib/fast-import/git-p4
+1 -1
@@ -1131,7 +1131,7 @@ class P4Sync(Command):
1131 system("git update-ref %s refs/heads/p4" % self.branch)
1132 system("git branch -D p4");
1133 # create it /after/ importing, when master exists
1134 - if not gitBranchExists(self.refPrefix + "HEAD") and self.importIntoRemotes:
1134 + if not gitBranchExists(self.refPrefix + "HEAD") and self.importIntoRemotes and gitBranchExists(self.branch):
1135 system("git symbolic-ref %sHEAD %s" % (self.refPrefix, self.branch))
1136
1137 # TODO: should always look at previous commits,