diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-07-31 20:41:38 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2014-07-31 20:41:38 -0400 |
commit | 92df942545fb2536b42b7c63f45d3293db326754 (patch) | |
tree | e99d00cfb0991da110af99dd56fc0e9e2e6e3b72 | |
parent | 93883e62b3228071cd9d15a7e9c49a1840611b26 (diff) | |
download | asp32-92df942545fb2536b42b7c63f45d3293db326754.tar.xz |
add hack to migrate bare repos to repos con arboles
-rw-r--r-- | asp.in | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -95,14 +95,27 @@ update_packages() { done } +migrate_bare_repo() { + files=(branches hooks info objects logs refs config description + {FETCH_,}HEAD) + + { # figure out when to get rid of this + git config 'core.bare' 'false' + mkdir .git + mv "${files[@]}" .git + } 2>/dev/null +} + initialize() { local remote - if [[ -d .git && OPT_FORCE -eq 0 ]]; then - log_fatal 'refusing to overwrite existing repo in %s' "$ASPROOT" + if [[ -s config && $(git config core.bare) = 'true' ]]; then + migrate_bare_repo fi - git init --bare || return 1 + [[ -f .asp ]] && return 0 + + git init || return 1 for remote in "${ARCH_GIT_REPOS[@]}"; do rm -rf "$remote" @@ -175,7 +188,7 @@ disk_usage() { umask 0022 startdir=$PWD cd "$ASPROOT" || log_fatal "ASPROOT ($ASPROOT) does not exist!" -[[ -f .asp ]] || initialize +initialize while getopts ':a:fhV' flag; do case $flag in |