Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spf13/afero
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.0
Choose a base ref
...
head repository: spf13/afero
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.1
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 10, 2022

  1. Copy the full SHA
    c2c1d12 View commit details
  2. fix actual value in test

    KastenMike committed Jan 10, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9440921 View commit details

Commits on Feb 5, 2022

  1. Merge pull request #334 from KastenMike/add-modTime-to-folders

    add modTime on folder creation
    0xmichalis authored Feb 5, 2022
    Copy the full SHA
    450b30f View commit details
Showing with 10 additions and 1 deletion.
  1. +1 −1 mem/file.go
  2. +9 −0 memmap_test.go
2 changes: 1 addition & 1 deletion mem/file.go
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ func CreateFile(name string) *FileData {
}

func CreateDir(name string) *FileData {
return &FileData{name: name, memDir: &DirMap{}, dir: true}
return &FileData{name: name, memDir: &DirMap{}, dir: true, modtime: time.Now()}
}

func ChangeFileName(f *FileData, newname string) {
9 changes: 9 additions & 0 deletions memmap_test.go
Original file line number Diff line number Diff line change
@@ -450,6 +450,9 @@ func TestMemFsMkdirAllMode(t *testing.T) {
if !info.Mode().IsDir() {
t.Error("/a: mode is not directory")
}
if !info.ModTime().After(time.Now().Add(-1 * time.Hour)) {
t.Errorf("/a: mod time not set, got %s", info.ModTime())
}
if info.Mode() != os.FileMode(os.ModeDir|0755) {
t.Errorf("/a: wrong permissions, expected drwxr-xr-x, got %s", info.Mode())
}
@@ -463,6 +466,9 @@ func TestMemFsMkdirAllMode(t *testing.T) {
if info.Mode() != os.FileMode(os.ModeDir|0755) {
t.Errorf("/a/b: wrong permissions, expected drwxr-xr-x, got %s", info.Mode())
}
if !info.ModTime().After(time.Now().Add(-1 * time.Hour)) {
t.Errorf("/a/b: mod time not set, got %s", info.ModTime())
}
info, err = fs.Stat("/a/b/c")
if err != nil {
t.Fatal(err)
@@ -473,6 +479,9 @@ func TestMemFsMkdirAllMode(t *testing.T) {
if info.Mode() != os.FileMode(os.ModeDir|0755) {
t.Errorf("/a/b/c: wrong permissions, expected drwxr-xr-x, got %s", info.Mode())
}
if !info.ModTime().After(time.Now().Add(-1 * time.Hour)) {
t.Errorf("/a/b/c: mod time not set, got %s", info.ModTime())
}
}

// MkdirAll does not change permissions of already-existing directories