[PATCH 1/3] Set cmdline globally, not in stop_here_user_resolve
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jun 1, 2010, 09:20 UTC
- Message-ID
- <1275384022-12131-2-git-send-email-artagnon@gmail.com>
- In-Reply-To
- <1275384022-12131-1-git-send-email-artagnon@gmail.com>
Set the $cmdline variable globally, so it can be used in other code fragments as well. Also, instead of hardcoding the string "git am", use the command line argument "$0".
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> --- git-am.sh | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/git-am.sh b/git-am.sh index 87ffae2..b779277 100755 --- a/git-am.sh +++ b/git-am.sh @@ -52,6 +52,16 @@ else HAS_HEAD= fi +cmdline="$0" +if test '' != "$interactive" +then + cmdline="$cmdline -i" +fi +if test '' != "$threeway" +then + cmdline="$cmdline -3" +fi + sq () { git rev-parse --sq-quote "$@" } @@ -66,15 +76,6 @@ stop_here_user_resolve () { printf '%s\n' "$resolvemsg" stop_here $1 fi - cmdline="git am" - if test '' != "$interactive" - then - cmdline="$cmdline -i" - fi - if test '' != "$threeway" - then - cmdline="$cmdline -3" - fi echo "When you have resolved this problem run \"$cmdline --resolved\"." echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"." echo "To restore the original branch and stop patching run \"$cmdline --abort\"."
-- 1.7.1