webapp: When told to add a git repository on a remote server, and the repository already exists as a non-bare repository, use it, rather than initializing a bare repository in the same directory.

This commit is contained in:
Joey Hess 2013-04-22 16:21:37 -04:00
parent 478b14b3c9
commit e92a207df5
3 changed files with 10 additions and 1 deletions

View file

@ -290,7 +290,7 @@ makeSsh' rsync setup sshdata keypair =
remoteCommand = shellWrap $ join "&&" $ catMaybes
[ Just $ "mkdir -p " ++ shellEscape remotedir
, Just $ "cd " ++ shellEscape remotedir
, if rsync then Nothing else Just "git init --bare --shared"
, if rsync then Nothing else Just "if [ ! -d .git ]; then git init --bare --shared; fi"
, if rsync then Nothing else Just "git annex init"
, if needsPubKey sshdata
then addAuthorizedKeysCommand (rsyncOnly sshdata) remotedir . sshPubKey <$> keypair

3
debian/changelog vendored
View file

@ -13,6 +13,9 @@ git-annex (4.20130418) UNRELEASED; urgency=low
don't have user.name set in git config, and put in a workaround
so that commits to the git-annex branch (and the assistant)
will still succeed despite git not liking the system configuration.
* webapp: When told to add a git repository on a remote server, and
the repository already exists as a non-bare repository, use it,
rather than initializing a bare repository in the same directory.
-- Joey Hess <joeyh@debian.org> Thu, 18 Apr 2013 16:22:48 -0400

View file

@ -13,3 +13,9 @@ git-annex version: 4.20130324, Ubuntu 11.04
**Please provide any additional information below.**
[[!tag /design/assistant]]
> I have made it check for the .git directory and reuse the existing
> repository if it's there. [[done]] --[[Joey]]
>
> (The comment about `git-annex-shell` is incorrect; it has nothing
> to do with this.)