Skip to content

Commit 0058a33

Browse files
tronicalgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5ca4461 commit 0058a33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/fast-import/git-p4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ class P4Sync(Command):
11311131
system("git update-ref %s refs/heads/p4" % self.branch)
11321132
system("git branch -D p4");
11331133
# 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):
11351135
system("git symbolic-ref %sHEAD %s" % (self.refPrefix, self.branch))
11361136

11371137
# TODO: should always look at previous commits,

0 commit comments

Comments
 (0)