From 6cf9397bd6aadf659efb5104af4d3f37b0753d73 Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Wed, 14 Sep 2016 12:00:41 +0200 Subject: [PATCH] Do not rely on git internals, support Git >= 2.10 Fast-export has traditionally sourced the internal git-sh-setup from Git, following the release of Git 2.10 this no longer works. Fast-export only uses the functionality of git-sh-setup for two things: cd:ing to the git repo dir and setting up the GIT_REPO environment variable. To future-proof fast-export start doing what we need by hand in fast-export. Acknowledgments to Louis Sautier who reported the problem and tested the fix. --- hg-fast-export.sh | 6 ++++-- hg-reset.sh | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hg-fast-export.sh b/hg-fast-export.sh index 190b783..f3f58f6 100755 --- a/hg-fast-export.sh +++ b/hg-fast-export.sh @@ -48,8 +48,10 @@ case "$1" in echo "$LONG_USAGE" exit 0 esac -. "$(git --exec-path)/git-sh-setup" -cd_to_toplevel + +cd $(git rev-parse --show-toplevel) \ + || (echo "Could not find git repo" ; exit 1) +GIT_DIR=$(git rev-parse --git-dir) || exit 1 while case "$#" in 0) break ;; esac do diff --git a/hg-reset.sh b/hg-reset.sh index 7fbacdf..d7fbff7 100755 --- a/hg-reset.sh +++ b/hg-reset.sh @@ -24,8 +24,9 @@ Options: -r Mercurial repository to use " -. "$(git --exec-path)/git-sh-setup" -cd_to_toplevel +cd $(git rev-parse --show-toplevel) \ + || (echo "Could not find git repo" ; exit 1) +GIT_DIR=$(git rev-parse --git-dir) || exit 1 while case "$#" in 0) break ;; esac do -- 2.11.4.GIT