summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-19 17:53:19 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-19 18:25:12 -0400
commit243b4c911e10060ab11c1d759d4100c92cdda9d9 (patch)
treea7a0e13012b63d03da83dc1df0e57cceb1fc41d2 /src
parentd792dad1b0636234894f704e9222ddebe84f336f (diff)
gitget: correctly handle the -f[orce] flag on bare repositories
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gitget/gitget10
1 files changed, 7 insertions, 3 deletions
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