diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-05-29 14:20:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-29 14:20:25 -0700 |
commit | 1ccb22d524e4809d5a8282603f0d5433cf2cbb8c (patch) | |
tree | 523d3776bcd55b25ef5e721f15843c3ca9cb6108 | |
parent | Merge branch 'fc/transport-helper-error-reporting' (diff) | |
parent | git-remote-testgit: build it to run under $SHELL_PATH (diff) | |
download | tgif-1ccb22d524e4809d5a8282603f0d5433cf2cbb8c.tar.xz |
Merge branch 'js/transport-helper-error-reporting-fix'
Finishing touches to fc/transport-helper-error-reporting topic.
* js/transport-helper-error-reporting-fix:
git-remote-testgit: build it to run under $SHELL_PATH
git-remote-testgit: further remove some bashisms
git-remote-testgit: avoid process substitution
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | git-remote-testgit.sh (renamed from git-remote-testgit) | 26 | ||||
-rwxr-xr-x | t/t5801-remote-helpers.sh | 5 |
4 files changed, 18 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore index 6669bf0c6c..10aee94760 100644 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,7 @@ /git-remote-ftps /git-remote-fd /git-remote-ext +/git-remote-testgit /git-remote-testpy /git-remote-testsvn /git-repack @@ -460,6 +460,7 @@ SCRIPT_SH += git-mergetool.sh SCRIPT_SH += git-pull.sh SCRIPT_SH += git-quiltimport.sh SCRIPT_SH += git-rebase.sh +SCRIPT_SH += git-remote-testgit.sh SCRIPT_SH += git-repack.sh SCRIPT_SH += git-request-pull.sh SCRIPT_SH += git-stash.sh diff --git a/git-remote-testgit b/git-remote-testgit.sh index 2b865deeb1..2109070d00 100755 --- a/git-remote-testgit +++ b/git-remote-testgit.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Copyright (c) 2012 Felipe Contreras alias=$1 @@ -23,7 +23,6 @@ then testgitmarks="$dir/testgit.marks" test -e "$gitmarks" || >"$gitmarks" test -e "$testgitmarks" || >"$testgitmarks" - testgitmarks_args=( "--"{import,export}"-marks=$testgitmarks" ) fi while read line @@ -70,7 +69,10 @@ do fi echo "feature done" - git fast-export "${testgitmarks_args[@]}" $refs | + git fast-export \ + ${testgitmarks:+"--import-marks=$testgitmarks"} \ + ${testgitmarks:+"--export-marks=$testgitmarks"} \ + $refs | sed -e "s#refs/heads/#${prefix}/heads/#g" echo "done" ;; @@ -87,17 +89,21 @@ do exit 1 fi - before=$(git for-each-ref --format='%(refname) %(objectname)') + before=$(git for-each-ref --format=' %(refname) %(objectname) ') - git fast-import "${testgitmarks_args[@]}" --quiet - - after=$(git for-each-ref --format='%(refname) %(objectname)') + git fast-import \ + ${testgitmarks:+"--import-marks=$testgitmarks"} \ + ${testgitmarks:+"--export-marks=$testgitmarks"} \ + --quiet # figure out which refs were updated - join -e 0 -o '0 1.2 2.2' -a 2 <(echo "$before") <(echo "$after") | - while read ref a b + git for-each-ref --format='%(refname) %(objectname)' | + while read ref a do - test $a == $b && continue + case "$before" in + *" $ref $a "*) + continue ;; # unchanged + esac if test -z "$GIT_REMOTE_TESTGIT_PUSH_ERROR" then echo "ok $ref" diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 16faa23154..4899af3f7a 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -8,11 +8,6 @@ test_description='Test remote-helper import and export commands' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh -if ! type "${BASH-bash}" >/dev/null 2>&1; then - skip_all='skipping remote-testgit tests, bash not available' - test_done -fi - compare_refs() { git --git-dir="$1/.git" rev-parse --verify $2 >expect && git --git-dir="$3/.git" rev-parse --verify $4 >actual && |