]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tk/p4-with-explicity-sync'
authorJunio C Hamano <gitster@pobox.com>
Fri, 20 May 2022 22:26:55 +0000 (15:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 May 2022 22:26:55 +0000 (15:26 -0700)
"git p4" update.

* tk/p4-with-explicity-sync:
  git-p4: support explicit sync of arbitrary existing git-p4 refs

1  2 
git-p4.py

diff --cc git-p4.py
index 1d83cdea587e2451ab918cdef4dc737432048004,48d5805ee41116ec411959aaba465ab6b21838c1..3119f5b5fdf01fa81302d65155c89c3876f2a23b
+++ b/git-p4.py
@@@ -3920,9 -3780,13 +3949,13 @@@ class P4Sync(Command, P4UserMap)
  
              # restrict to just this one, disabling detect-branches
              if branch_arg_given:
-                 short = self.branch.split("/")[-1]
+                 short = shortP4Ref(self.branch, self.importIntoRemotes)
                  if short in branches:
 -                    self.p4BranchesInGit = [ short ]
 +                    self.p4BranchesInGit = [short]
+                 elif self.branch.startswith('refs/') and \
+                         branchExists(self.branch) and \
+                         '[git-p4:' in extractLogMessageFromGitCommit(self.branch):
 -                    self.p4BranchesInGit = [ self.branch ]
++                    self.p4BranchesInGit = [self.branch]
              else:
                  self.p4BranchesInGit = branches.keys()