Skip to content

Commit e32e00d

Browse files
Pete Wyckoffgitster
authored andcommitted
git-p4: better message for "git-p4 sync" when not cloned
A common error is to do "git-p4 sync" in a repository that was not initialized by "git-p4 clone". There will be no p4 refs. The error message in this case is a traceback for an assertion, which is confusing. Change it instead to explain the likely problem. Signed-off-by: Pete Wyckoff <[email protected]> Acked-By: Tor Arvid Lund <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d88e707 commit e32e00d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/fast-import/git-p4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,8 @@ class P4Sync(Command):
16761676

16771677
changes.sort()
16781678
else:
1679+
if not self.p4BranchesInGit:
1680+
die("No remote p4 branches. Perhaps you never did \"git p4 clone\" in here.");
16791681
if self.verbose:
16801682
print "Getting p4 changes for %s...%s" % (', '.join(self.depotPaths),
16811683
self.changeRange)

0 commit comments

Comments
 (0)