add: Consistently treat files in a dotdir as dotfiles, even when ran inside that dotdir

Assistant and smudge also updated.

This does add a small amount of extra work, getting the TopFilePath.
Not enough to be concerned by.

Also improve documentation to make clear that files inside dotdirs are
treated as dotfiles.

Sponsored-by: Eve on Patreon
This commit is contained in:
Joey Hess 2024-11-13 13:42:52 -04:00
parent 1f59dae0bd
commit 876d5b6c6f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 88 additions and 41 deletions

View file

@ -94,17 +94,19 @@ seek' o = do
addunlockedmatcher <- addUnlockedMatcher
annexdotfiles <- getGitConfigVal annexDotFiles
let gofile includingsmall (si, file) = case largeFilesOverride o of
Nothing -> ifM (pure (annexdotfiles || not (dotfile file))
<&&> (checkFileMatcher NoLiveUpdate largematcher file
<||> Annex.getRead Annex.force))
( start dr si file addunlockedmatcher
, if includingsmall
then ifM (annexAddSmallFiles <$> Annex.getGitConfig)
( startSmall dr si file
, stop
)
else stop
)
Nothing -> do
topfile <- getTopFilePath <$> inRepo (toTopFilePath file)
ifM (pure (annexdotfiles || not (dotfile topfile))
<&&> (checkFileMatcher NoLiveUpdate largematcher file
<||> Annex.getRead Annex.force))
( start dr si file addunlockedmatcher
, if includingsmall
then ifM (annexAddSmallFiles <$> Annex.getGitConfig)
( startSmall dr si file
, stop
)
else stop
)
Just True -> start dr si file addunlockedmatcher
Just False -> startSmallOverridden dr si file
case batchOption o of