git-annex/Git
Joey Hess 43f19ef00a
Fix bug that made bare repos be treated as non-bare when --git-dir was used.
Eg:

git clone url --bare r
git --git-dir r annex init

This resulted in worktree = Just "." and so several things that check
worktree to determine when the repo is bare ran code paths intended for
non-bare. One such code path[1] ran git checkout with --worktree=. which
actually makes it ignore core.bare config, and so the current directory
got populated with a checkout of the master branch in this example. There
was probably also other breakage.

The fix is a bit complicated because whether the repo is bare is not
known until after Git.Config reads the config, but Git.Config handles
setting the RepoLocations's worktree when core.worktree is set. So have
to assume the worktree is the cwd, let core.worktree override that,
and then if the repo turns out to be bare, it's set back to Nothing.
(And then GIT_WORK_TREE can still override all of that.)

[1] switchHEADBack, which runs even when the clone is not from a bare repo.
2019-11-21 13:26:02 -04:00
..
Command update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Remote Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
AutoCorrect.hs update wording to match current wording in git 2019-09-15 19:01:05 -04:00
Branch.hs Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
BuildVersion.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
CatFile.hs work around windows having infected git's plumbing 2019-10-08 15:27:05 -04:00
CheckAttr.hs Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
CheckIgnore.hs Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
Command.hs fix incorrect comment 2019-04-24 14:29:46 -04:00
Config.hs git-lfs: remember urls, and autoenable remotes using known urls 2019-11-18 16:09:09 -04:00
ConfigTypes.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Construct.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Credential.hs typo 2019-09-24 14:34:15 -04:00
CurrentRepo.hs Fix bug that made bare repos be treated as non-bare when --git-dir was used. 2019-11-21 13:26:02 -04:00
DiffTree.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
DiffTreeItem.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Env.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
FileMode.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Filename.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
FilePath.hs benchmark: Add --databases to benchmark sqlite databases 2019-10-29 16:59:27 -04:00
Fsck.hs Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
GCrypt.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
HashObject.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
History.hs don't empty historyCommitParents 2019-05-01 13:38:40 -04:00
Hook.hs init: Install working hook scripts when run on a crippled filesystem and on Windows 2019-08-13 15:14:17 -04:00
Index.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
LockFile.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
LsFiles.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
LsTree.hs add back non-preferred files to imported tree 2019-05-20 16:43:52 -04:00
Merge.hs Removed support for git versions older than 2.1 2019-09-11 16:14:43 -04:00
Objects.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Queue.hs remove one more warningIO 2019-11-12 10:45:52 -04:00
Ref.hs add --verify 2019-05-06 16:41:01 -04:00
RefLog.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Remote.hs git-lfs: remember urls, and autoenable remotes using known urls 2019-11-18 16:09:09 -04:00
Repair.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Sha.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Ssh.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Status.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Tree.hs sync: Fix crash when there are submodules and an adjusted branch is checked out 2019-10-23 11:52:56 -04:00
Types.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
UnionMerge.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
UpdateIndex.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Url.hs lfs endpoint discovery and caching in git-lfs special remote 2019-08-02 12:38:14 -04:00
Version.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00