@matheusbsbs / matheus-bagliano / commits / accad8e05e
Fork 0

git-p4: fix sync new branch regression

e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke another use case, that of using "git-p4 sync" to import a new branch into an existing repository. Refine the fix again, on top of the fix in ac34efc. Reported-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Tested-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Mar 16, 2011 at 16:52 UTC accad8e05e7503e456798a35e8bba6f83d8ad8b6
1 file changed +3 -1
contrib/fast-import/git-p4
+3 -1
@@ -1694,7 +1694,9 @@ class P4Sync(Command):
1694
1695 changes.sort()
1696 else:
1697 - if not isinstance(self, P4Clone) and not self.p4BranchesInGit:
1697 + # catch "git-p4 sync" with no new branches, in a repo that
1698 + # does not have any existing git-p4 branches
1699 + if len(args) == 0 and not self.p4BranchesInGit:
1700 die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.");
1701 if self.verbose:
1702 print "Getting p4 changes for %s...%s" % (', '.join(self.depotPaths),