summaryrefslogtreecommitdiffstats
path: root/t/invalid-refnames-filenames.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:55:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:55:51 +0000
commit7685305e1f82212323ec32a321b1f5c623751b6c (patch)
treea1af617672e26aee4c1031a3aa83e8ff08f6a0a5 /t/invalid-refnames-filenames.t
parentInitial commit. (diff)
downloadgitolite3-7685305e1f82212323ec32a321b1f5c623751b6c.tar.xz
gitolite3-7685305e1f82212323ec32a321b1f5c623751b6c.zip
Adding upstream version 3.6.12.upstream/3.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/invalid-refnames-filenames.t')
-rwxr-xr-xt/invalid-refnames-filenames.t100
1 files changed, 100 insertions, 0 deletions
diff --git a/t/invalid-refnames-filenames.t b/t/invalid-refnames-filenames.t
new file mode 100755
index 0000000..19267fe
--- /dev/null
+++ b/t/invalid-refnames-filenames.t
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+# this is hardcoded; change it if needed
+use lib "src/lib";
+use Gitolite::Test;
+
+# invalid refnames
+# ----------------------------------------------------------------------
+
+try "plan 56";
+try "DEF POK = !/DENIED/; !/failed to push/";
+
+confreset; confadd '
+ repo aa
+ RW+ = @all
+';
+
+try "ADMIN_PUSH set1; !/FATAL/" or die text();
+
+try "
+
+cd ..
+rm -rf aa
+glt clone u1 file:///aa
+cd aa
+tc v-869
+
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /\\* \\[new branch\\] HEAD -> master/
+
+# push file aa,bb ok
+tc aa,bb
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /HEAD -> master/
+
+# push file aa=bb ok
+tc aa=bb
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /HEAD -> master/
+
+# push to branch dd,ee ok
+glt push u1 origin master:dd,ee
+ /To file:///aa/
+ POK; /\\* \\[new branch\\] master -> dd,ee/
+
+# push to branch dd=ee fail
+glt push u1 origin master:dd=ee
+ /invalid characters in ref or filename: \\'refs/heads/dd=ee/
+ reject
+";
+
+confreset; confadd '
+ repo aa
+ RW+ = @all
+ RW+ NAME/ = @all
+';
+
+try "ADMIN_PUSH set1; !/FATAL/" or die text();
+
+try "
+
+cd ..
+rm -rf aa
+glt clone u1 file:///aa
+cd aa
+tc file-1
+
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /\\* \\[new branch\\] HEAD -> master/
+
+# push file aa,bb ok
+tc aa,bb
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /HEAD -> master/
+
+# push file aa=bb fail
+tc aa=bb
+glt push u1 origin HEAD
+ /To file:///aa/
+ POK; /HEAD -> master/
+
+# push to branch dd,ee ok
+git reset --hard HEAD^
+tc some-file
+glt push u1 origin master:dd,ee
+ /To file:///aa/
+ POK; /\\* \\[new branch\\] master -> dd,ee/
+
+# push to branch dd=ee fail
+glt push u1 origin master:dd=ee
+ /invalid characters in ref or filename: \\'refs/heads/dd=ee/
+ reject
+";