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>

Lars Schneider committed Jun 29, 2016 at 09:35 UTC d604176d23a69c7f690f0379b82b789732a4278f
2 files changed +3 -3
git-p4.py
+1 -1
@@ -2274,7 +2274,7 @@ class P4Sync(Command, P4UserMap):
2274 self.useClientSpec_from_options = False
2275 self.clientSpecDirs = None
2276 self.tempBranches = []
2277 - self.tempBranchLocation = "git-p4-tmp"
2277 + self.tempBranchLocation = "refs/git-p4-tmp"
2278 self.largeFileSystem = None
2279
2280 if gitConfig('git-p4.largeFileSystem'):
t/t9801-git-p4-branch.sh
+2 -2
@@ -300,7 +300,7 @@ test_expect_success 'git p4 clone complex branches' '
300 test_path_is_file file2 &&
301 test_path_is_file file3 &&
302 ! grep update file2 &&
303 - test_path_is_missing .git/git-p4-tmp
303 + test_must_fail git show-ref --verify refs/git-p4-tmp
304 )
305 '
306
@@ -352,7 +352,7 @@ test_expect_success 'git p4 sync changes to two branches in the same changelist'
352 test_path_is_file file2 &&
353 test_path_is_file file3 &&
354 ! grep update file2 &&
355 - test_path_is_missing .git/git-p4-tmp
355 + test_must_fail git show-ref --verify refs/git-p4-tmp
356 )
357 '
358