Skip to content

Commit 6a16726

Browse files
committed
git-hg-synchronizer: use remote helper from Git's contrib/
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ee0bb05 commit 6a16726

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

git-hg-synchronizer.sh

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,18 @@
55

66
set -e
77

8-
GIT_HG="$(cd ../../ && pwd)"/git-hg
9-
test -d "$GIT_HG"/src || {
10-
mkdir -p "$GIT_HG"
11-
git clone git://github.com/msysgit/git "$GIT_HG"/src
12-
}
13-
test -x "$GIT_HG"/bin/git || (
14-
if ! dpkg -l libcurl4-openssl-dev libexpat1-dev gettext mercurial \
15-
> /dev/null
8+
type git-remote-hg > /dev/null 2>&1 || {
9+
mkdir -p "$HOME"/bin &&
10+
if test ! -x "$HOME"/bin/git-remote-hg
1611
then
17-
echo "Missing packages" >&2
18-
exit 1
19-
fi
20-
cd "$GIT_HG"/src &&
21-
git checkout devel &&
22-
make install prefix="$GIT_HG"
23-
)
24-
25-
export PATH="$GIT_HG"/bin:$PATH
12+
curl -Lfs https://github.com/msysgit/git/raw/master/contrib/remote-helpers/git-remote-hg > "$HOME"/bin/git-remote-hg &&
13+
chmod a+x "$HOME"/bin/git-remote-hg
14+
fi &&
15+
export PATH="$HOME"/bin:$PATH
16+
} || {
17+
echo "Could not install git-remote-hg" >&2
18+
exit 1
19+
}
2620

2721
HG_URL="$1"
2822
shift

0 commit comments

Comments
 (0)