summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2011-12-24 21:07:40 -0500
committerJunio C Hamano <gitster@pobox.com>2011-12-27 10:19:31 -0800
commit28755dbaa5213032b2da202652c214a9f94ff853 (patch)
tree68af619b99ccd56db44d4800fc2528b8812932aa /contrib/fast-import
parent09fca77b9ecd64e2008835208bab29e15a4b2809 (diff)
downloadgit-28755dbaa5213032b2da202652c214a9f94ff853.tar.gz
git-p4: document and test submit optionspw/p4-docs-and-tests
Clarify there is a -M option, but no -C. These are both configurable through variables. Explain that the allowSubmit variable takes a comma-separated list of branch names. Catch earlier an invalid branch name given as an argument to "git p4 clone". Test option --origin, variable allowSubmit, and explicit master branch name. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p47
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 5420bf1368..d3c3ad859c 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -362,6 +362,11 @@ def isValidGitDir(path):
def parseRevision(ref):
return read_pipe("git rev-parse %s" % ref).strip()
+def branchExists(ref):
+ rev = read_pipe(["git", "rev-parse", "-q", "--verify", ref],
+ ignore_error=True)
+ return len(rev) > 0
+
def extractLogMessageFromGitCommit(commit):
logMessage = ""
@@ -1089,6 +1094,8 @@ class P4Submit(Command, P4UserMap):
die("Detecting current git branch failed!")
elif len(args) == 1:
self.master = args[0]
+ if not branchExists(self.master):
+ die("Branch %s does not exist" % self.master)
else:
return False