Skip to content

Commit d604176

Browse files
larsxschneidergitster
authored andcommitted
git-p4: place temporary refs used for branch import under refs/git-p4-tmp
Git-P4 used to place temporary refs under "git-p4-tmp". Since 3da1f37 Git checks that all refs are placed under "refs". Instruct Git-P4 to place temporary refs under "refs/git-p4-tmp". There are no backwards compatibility considerations as these refs are transient. Use "git show-ref --verify" to check the (non-)existience of the refs instead of file checks assuming the file-based ref backend. All refs under "refs" are shared across all worktrees. This is not desired for temporary Git-P4 refs and will be adressed in a later patch. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Vitor Antunes <vitor.hda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cf4c2cf commit d604176

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

git-p4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ def __init__(self):
22742274
self.useClientSpec_from_options = False
22752275
self.clientSpecDirs = None
22762276
self.tempBranches = []
2277-
self.tempBranchLocation = "git-p4-tmp"
2277+
self.tempBranchLocation = "refs/git-p4-tmp"
22782278
self.largeFileSystem = None
22792279

22802280
if gitConfig('git-p4.largeFileSystem'):

t/t9801-git-p4-branch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ test_expect_success 'git p4 clone complex branches' '
300300
test_path_is_file file2 &&
301301
test_path_is_file file3 &&
302302
! grep update file2 &&
303-
test_path_is_missing .git/git-p4-tmp
303+
test_must_fail git show-ref --verify refs/git-p4-tmp
304304
)
305305
'
306306

@@ -352,7 +352,7 @@ test_expect_success 'git p4 sync changes to two branches in the same changelist'
352352
test_path_is_file file2 &&
353353
test_path_is_file file3 &&
354354
! grep update file2 &&
355-
test_path_is_missing .git/git-p4-tmp
355+
test_must_fail git show-ref --verify refs/git-p4-tmp
356356
)
357357
'
358358

0 commit comments

Comments
 (0)