List a directory named through a symlink in gen and freshen (closes #185)
check / check (push) Waiting to run
check / check (push) Waiting to run
The walk in gen and freshen does not follow a symlink at its top. A directory given as a symlink, or a working directory whose path names one, was listed as empty and gen exited 0, while freshen removed every entry from the manifest. Each walk now resolves its starting directory with filepath.EvalSymlinks first, as check's search for extra files does, and starts at the path as named if that fails. Symlinks inside the tree are still skipped unless --follow-symlinks is given. Model: opus-5-5
This commit was merged in pull request #186.
This commit is contained in:
@@ -379,6 +379,14 @@ func (mfa *CLIApp) freshenScan(
|
||||
}
|
||||
}
|
||||
|
||||
// The walk does not follow a symlink at its top, so a base directory
|
||||
// named through one is resolved first. If that fails, the base is
|
||||
// walked as named and the walk reports the problem.
|
||||
resolved, err := filepath.EvalSymlinks(absBase)
|
||||
if err == nil {
|
||||
absBase = resolved
|
||||
}
|
||||
|
||||
scanner := &freshenScanner{
|
||||
fs: mfa.Fs,
|
||||
absBase: absBase,
|
||||
@@ -390,7 +398,7 @@ func (mfa *CLIApp) freshenScan(
|
||||
existingByPath: existingByPath,
|
||||
}
|
||||
|
||||
err := afero.Walk(mfa.Fs, absBase, scanner.walk)
|
||||
err = afero.Walk(mfa.Fs, absBase, scanner.walk)
|
||||
|
||||
if showProgress {
|
||||
log.ProgressDone()
|
||||
|
||||
Reference in New Issue
Block a user