Patchwork [2,of,2,fix-old-git] tests: protect tests involving git ext::sh with git-ext-sh

login
register
mail settings
Submitter Sean Farley
Date June 16, 2017, 4:59 a.m.
Message ID <583fc99ba48a30b6e1b7.1497589176@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/21424/
State Changes Requested
Headers show

Comments

Sean Farley - June 16, 2017, 4:59 a.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1497572093 25200
#      Thu Jun 15 17:14:53 2017 -0700
# Branch fix-old-git
# Node ID 583fc99ba48a30b6e1b72493a017be7313e7acbd
# Parent  658fbb62fe6b37fbf2da80430a291dd37f16eb9a
tests: protect tests involving git ext::sh with git-ext-sh

Patch

diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
index a08f813..39f6e01 100644
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -946,11 +946,11 @@  damage git repository by renaming a tree
   $ TREE_OBJ=72/49f083d2a63a41cc737764a86981eb5f3e4635
   $ mv git-repo4/.git/objects/$TREE_OBJ git-repo4/.git/objects/$TREE_OBJ.tmp
   $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:'
   abort: cannot read changes in 1c0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd
 
-#if no-windows
+#if no-windows git-ext-sh
 
 test for escaping the repo name (CVE-2016-3069)
 
   $ git init '`echo pwned >COMMAND-INJECTION`'
   Initialized empty Git repository in $TESTTMP/`echo pwned >COMMAND-INJECTION`/.git/
diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
index 2321bd3..0225075 100644
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -1135,10 +1135,12 @@  make sure we show changed files, rather 
   ? s/c.c
   ? s/cpp.cpp
   ? s/foobar.orig
   ? s/snake.python.orig
 
+#if git-ext-sh
+
 test for Git CVE-2016-3068
   $ hg init malicious-subrepository
   $ cd malicious-subrepository
   $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub
   $ git init s
@@ -1176,5 +1178,7 @@  whitelisting of ext should be respected 
   cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
   abort: git clone error 128 in s (in subrepo s)
   [255]
   $ f -Dq pwned.txt
   pwned: you asked for it
+
+#endif