From 243b4c911e10060ab11c1d759d4100c92cdda9d9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 19 Apr 2017 17:53:19 -0400 Subject: gitget: correctly handle the -f[orce] flag on bare repositories --- src/gitget/gitget | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gitget/gitget b/src/gitget/gitget index 4d127c7..c941441 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -116,9 +116,13 @@ download_git_bare() { cd_safe "$dir" # Make sure we are fetching the right repo if [[ "$url" != "$(git config --get remote.origin.url)" ]] ; then - error "%s is not a clone of %s" "$dir" "$url" - plain "Aborting..." - exit 1 + if $FORCE; then + git config remote.origin.url "$url" + else + error "%s is not a clone of %s" "$dir" "$url" + plain "Aborting..." + exit 1 + fi fi if [[ -n $push ]] ; then if $FORCE; then -- cgit v1.2.3-54-g00ecf