Skip to content

Commit 9ceab36

Browse files
committed
Make it possible to specify the HEAD for the internal findUpstreamBranchPoint function.
This isn't used right now in git-p4 but I use it in an external script that loads git-p4 as module. Signed-off-by: Simon Hausmann <[email protected]>
1 parent 09d89de commit 9ceab36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/fast-import/git-p4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ def gitBranchExists(branch):
168168
def gitConfig(key):
169169
return read_pipe("git config %s" % key, ignore_error=True).strip()
170170

171-
def findUpstreamBranchPoint():
171+
def findUpstreamBranchPoint(head = "HEAD"):
172172
settings = None
173173
branchPoint = ""
174174
parent = 0
175175
while parent < 65535:
176-
commit = "HEAD~%s" % parent
176+
commit = head + "~%s" % parent
177177
log = extractLogMessageFromGitCommit(commit)
178178
settings = extractSettingsGitLog(log)
179179
if not settings.has_key("depot-paths"):

0 commit comments

Comments
 (0)