summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/test-hg-hg-git.sh
diff options
context:
space:
mode:
authorMax Horn <max@quendi.de>2013-01-15 13:02:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-15 18:01:11 (GMT)
commit3968e302f8d09104da9ede15079f1133df6d3b68 (patch)
tree0ff02242dfd67928840d7a3aea5fca323c99445d /contrib/remote-helpers/test-hg-hg-git.sh
parenteacf0117752780bf418d352a6ad2f033aeda1cce (diff)
downloadgit-3968e302f8d09104da9ede15079f1133df6d3b68.zip
git-3968e302f8d09104da9ede15079f1133df6d3b68.tar.gz
git-3968e302f8d09104da9ede15079f1133df6d3b68.tar.bz2
remote-hg: fix handling of file perms when pushing
Previously, when changing and committing an executable file, the file would loose its executable bit on the hg side. Likewise, symlinks ended up as "normal" files". This was not immediately apparent on the git side unless one did a fresh clone. Signed-off-by: Max Horn <max@quendi.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/test-hg-hg-git.sh')
-rwxr-xr-xcontrib/remote-helpers/test-hg-hg-git.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh
index 3e76d9f..7e3967f 100755
--- a/contrib/remote-helpers/test-hg-hg-git.sh
+++ b/contrib/remote-helpers/test-hg-hg-git.sh
@@ -109,6 +109,74 @@ setup () {
setup
+test_expect_success 'executable bit' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ git init -q gitrepo &&
+ cd gitrepo &&
+ echo alpha > alpha &&
+ chmod 0644 alpha &&
+ git add alpha &&
+ git commit -m "add alpha" &&
+ chmod 0755 alpha &&
+ git add alpha &&
+ git commit -m "set executable bit" &&
+ chmod 0644 alpha &&
+ git add alpha &&
+ git commit -m "clear executable bit"
+ ) &&
+
+ for x in hg git; do
+ (
+ hg_clone_$x gitrepo hgrepo-$x &&
+ cd hgrepo-$x &&
+ hg_log . &&
+ hg manifest -r 1 -v &&
+ hg manifest -v
+ ) > output-$x &&
+
+ git_clone_$x hgrepo-$x gitrepo2-$x &&
+ git_log gitrepo2-$x > log-$x
+ done &&
+ cp -r log-* output-* /tmp/foo/ &&
+
+ test_cmp output-hg output-git &&
+ test_cmp log-hg log-git
+'
+
+test_expect_success 'symlink' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ git init -q gitrepo &&
+ cd gitrepo &&
+ echo alpha > alpha &&
+ git add alpha &&
+ git commit -m "add alpha" &&
+ ln -s alpha beta &&
+ git add beta &&
+ git commit -m "add beta"
+ ) &&
+
+ for x in hg git; do
+ (
+ hg_clone_$x gitrepo hgrepo-$x &&
+ cd hgrepo-$x &&
+ hg_log . &&
+ hg manifest -v
+ ) > output-$x &&
+
+ git_clone_$x hgrepo-$x gitrepo2-$x &&
+ git_log gitrepo2-$x > log-$x
+ done &&
+
+ test_cmp output-hg output-git &&
+ test_cmp log-hg log-git
+'
+
test_expect_success 'merge conflict 1' '
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp" &&