From: Simon Hausmann Date: Fri, 24 Aug 2007 15:46:16 +0000 (+0200) Subject: git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when running git... X-Git-Tag: v1.5.3-rc7~26 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0058a33a8eb5a8bfcfc5f5e769a2517cff4b73f1;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index b571e3047..55778c577 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -1131,7 +1131,7 @@ class P4Sync(Command): 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(self.refPrefix + "HEAD") and self.importIntoRemotes: + if not gitBranchExists(self.refPrefix + "HEAD") and self.importIntoRemotes and gitBranchExists(self.branch): system("git symbolic-ref %sHEAD %s" % (self.refPrefix, self.branch)) # TODO: should always look at previous commits,