diff --git a/.gitignore b/.gitignore index 0e905b107..84258eeee 100644 --- a/.gitignore +++ b/.gitignore @@ -18,19 +18,21 @@ coverage.txt # Binaries lazygit +lazygit.exe # Exceptions !.gitignore !.goreleaser.yml !.circleci/ !.github/ +# these are for our integration tests +!.git_keep +!.gitmodules_keep test/git_server/data test/integration/*/actual/ test/integration/*/actual_remote/ test/integration/*/used_config/ # these sample hooks waste too much space -test/integration/*/expected/.git_keep/hooks/ -test/integration/*/expected_remote/hooks/ -!.git_keep/ -lazygit.exe +test/integration/*/expected/**/hooks/ +test/integration/*/expected_remote/**/hooks/ diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go index 1158fa85f..542624a6f 100644 --- a/pkg/integration/integration.go +++ b/pkg/integration/integration.go @@ -101,6 +101,7 @@ func RunTests( expectedRepoDir := filepath.Join(testPath, "expected") actualRemoteDir := filepath.Join(testPath, "actual_remote") expectedRemoteDir := filepath.Join(testPath, "expected_remote") + otherRepoDir := filepath.Join(testPath, "other_repo") logf("path: %s", testPath) for i, speed := range speeds { @@ -110,7 +111,8 @@ func RunTests( findOrCreateDir(testPath) prepareIntegrationTestDir(actualRepoDir) - removeRemoteDir(actualRemoteDir) + removeDir(otherRepoDir) + removeDir(actualRemoteDir) err := createFixture(testPath, actualRepoDir) if err != nil { return err @@ -128,16 +130,21 @@ func RunTests( return err } + // submodule tests currently make use of a repo called 'other_repo' but we don't want that + // to stick around. Long-term we should have an 'actual' folder which itself contains + // repos, and there we can put the 'repo' repo which is the main one, alongside + // any others that we use as part of the test (including remotes). Then we'll do snapshots for + // each of them. + removeDir(otherRepoDir) + if mode == UPDATE_SNAPSHOT || mode == RECORD { + // create/update snapshot err = oscommands.CopyDir(actualRepoDir, expectedRepoDir) if err != nil { return err } - err = os.Rename( - filepath.Join(expectedRepoDir, ".git"), - filepath.Join(expectedRepoDir, ".git_keep"), - ) - if err != nil { + + if err := renameGitDirs(expectedRepoDir); err != nil { return err } @@ -148,11 +155,12 @@ func RunTests( return err } } else { - removeRemoteDir(expectedRemoteDir) + removeDir(expectedRemoteDir) } - } - if mode != SANDBOX { + logf("%s", "updated snapshot") + } else { + // compare result to snapshot actualRepo, expectedRepo, err := generateSnapshots(actualRepoDir, expectedRepoDir) if err != nil { return err @@ -174,7 +182,7 @@ func RunTests( break } - // if the snapshots and we haven't tried all playback speeds different we'll retry at a slower speed + // if the snapshot doesn't match and we haven't tried all playback speeds different we'll retry at a slower speed if i == len(speeds)-1 { // get the log file and print that bytes, err := ioutil.ReadFile(filepath.Join(configDir, "development.log")) @@ -198,7 +206,7 @@ func RunTests( return nil } -func removeRemoteDir(dir string) { +func removeDir(dir string) { err := os.RemoveAll(dir) if err != nil { panic(err) @@ -334,6 +342,10 @@ func findOrCreateDir(path string) { } } +// note that we don't actually store this snapshot in the lazygit repo. +// Instead we store the whole expected git repo of our test, so that +// we can easily change what we want to compare without needing to regenerate +// snapshots for each test. func generateSnapshot(dir string) (string, error) { osCommand := oscommands.NewDummyOSCommand() @@ -345,18 +357,24 @@ func generateSnapshot(dir string) (string, error) { snapshot := "" cmdStrs := []string{ - fmt.Sprintf(`git -C %s status`, dir), // file tree - fmt.Sprintf(`git -C %s log --pretty=%%B -p -1`, dir), // log - fmt.Sprintf(`git -C %s tag -n`, dir), // tags + `status`, // file tree + `log --pretty=%B -p -1`, // log + `tag -n`, // tags + `stash list`, // stash + `submodule foreach 'git status'`, // submodule status + `submodule foreach 'git log --pretty=%B -p -1'`, // submodule log + `submodule foreach 'git tag -n'`, // submodule tags + `submodule foreach 'git stash list'`, // submodule stash } for _, cmdStr := range cmdStrs { // ignoring error for now. If there's an error it could be that there are no results - output, _ := osCommand.Cmd.New(cmdStr).RunWithOutput() + output, _ := osCommand.Cmd.New(fmt.Sprintf("git -C %s %s", dir, cmdStr)).RunWithOutput() - snapshot += output + "\n" + snapshot += fmt.Sprintf("git %s:\n%s\n", cmdStr, output) } + snapshot += "files in repo:\n" err = filepath.Walk(dir, func(path string, f os.FileInfo, err error) error { if err != nil { return err @@ -373,7 +391,12 @@ func generateSnapshot(dir string) (string, error) { if err != nil { return err } - snapshot += string(bytes) + "\n" + + relativePath, err := filepath.Rel(dir, path) + if err != nil { + return err + } + snapshot += fmt.Sprintf("path: %s\ncontent:\n%s\n", relativePath, string(bytes)) return nil }) @@ -391,24 +414,15 @@ func generateSnapshots(actualDir string, expectedDir string) (string, string, er return "", "", err } - // git refuses to track .git folders in subdirectories so we need to rename it - // to git_keep after running a test, and then change it back again defer func() { - err = os.Rename( - filepath.Join(expectedDir, ".git"), - filepath.Join(expectedDir, ".git_keep"), - ) - - if err != nil { + if err := renameGitDirs(expectedDir); err != nil { panic(err) } }() - // ignoring this error because we might not have a .git_keep file here yet. - _ = os.Rename( - filepath.Join(expectedDir, ".git_keep"), - filepath.Join(expectedDir, ".git"), - ) + if err := restoreGitDirs(expectedDir); err != nil { + return "", "", err + } expected, err := generateSnapshot(expectedDir) if err != nil { @@ -418,6 +432,57 @@ func generateSnapshots(actualDir string, expectedDir string) (string, string, er return actual, expected, nil } +func getPathsToRename(dir string, needle string) []string { + pathsToRename := []string{} + + err := filepath.Walk(dir, func(path string, f os.FileInfo, err error) error { + if err != nil { + return err + } + + if f.Name() == needle { + pathsToRename = append(pathsToRename, path) + } + + return nil + }) + if err != nil { + panic(err) + } + + return pathsToRename +} + +// Git refuses to track .git and .gitmodules folders in subdirectories so we need to rename it +// to git_keep after running a test, and then change it back again +var untrackedGitDirs []string = []string{".git", ".gitmodules"} + +func renameGitDirs(dir string) error { + for _, untrackedGitDir := range untrackedGitDirs { + for _, path := range getPathsToRename(dir, untrackedGitDir) { + err := os.Rename(path, path+"_keep") + if err != nil { + return err + } + } + } + + return nil +} + +func restoreGitDirs(dir string) error { + for _, untrackedGitDir := range untrackedGitDirs { + for _, path := range getPathsToRename(dir, untrackedGitDir+"_keep") { + err := os.Rename(path, strings.TrimSuffix(path, "_keep")) + if err != nil { + return err + } + } + } + + return nil +} + func generateSnapshotsForRemote(actualDir string, expectedDir string) (string, string, error) { actual, err := generateSnapshot(actualDir) if err != nil { diff --git a/test/integration/submoduleAdd/expected/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleAdd/expected/.git_keep/COMMIT_EDITMSG new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/COMMIT_EDITMSG @@ -0,0 +1 @@ +test diff --git a/test/integration/submoduleAdd/expected/.git_keep/FETCH_HEAD b/test/integration/submoduleAdd/expected/.git_keep/FETCH_HEAD new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/submoduleAdd/expected/.git_keep/HEAD b/test/integration/submoduleAdd/expected/.git_keep/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleAdd/expected/.git_keep/config b/test/integration/submoduleAdd/expected/.git_keep/config new file mode 100644 index 000000000..3770f8692 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + email = CI@example.com + name = CI +[submodule "blah"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/other_repo + active = true diff --git a/test/integration/submoduleAdd/expected/.git_keep/description b/test/integration/submoduleAdd/expected/.git_keep/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleAdd/expected/.git_keep/index b/test/integration/submoduleAdd/expected/.git_keep/index new file mode 100644 index 000000000..df11fba0b Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/index differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/info/exclude b/test/integration/submoduleAdd/expected/.git_keep/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleAdd/expected/.git_keep/logs/HEAD b/test/integration/submoduleAdd/expected/.git_keep/logs/HEAD new file mode 100644 index 000000000..df53976dc --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/logs/HEAD @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 6de70e35394a99cc437d1bc70b0852b70c5bb03d CI 1617797593 +1000 commit: test diff --git a/test/integration/submoduleAdd/expected/.git_keep/logs/refs/heads/master b/test/integration/submoduleAdd/expected/.git_keep/logs/refs/heads/master new file mode 100644 index 000000000..df53976dc --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 6de70e35394a99cc437d1bc70b0852b70c5bb03d CI 1617797593 +1000 commit: test diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/HEAD b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/config b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/config new file mode 100644 index 000000000..91988eba6 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/config @@ -0,0 +1,14 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true + worktree = ../../../haha +[remote "origin"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/other_repo + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/description b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/index b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/index new file mode 100644 index 000000000..64a52c781 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/index differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/info/exclude b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/HEAD b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/HEAD new file mode 100644 index 000000000..0ed3aba82 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1617797593 +1000 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/other_repo diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/heads/master b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/heads/master new file mode 100644 index 000000000..0ed3aba82 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1617797593 +1000 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/other_repo diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD new file mode 100644 index 000000000..0ed3aba82 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1617797593 +1000 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/other_repo diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/packed-refs b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/packed-refs new file mode 100644 index 000000000..2991aad64 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled sorted +42530e986dbb65877ed8d61ca0c816e425e5c62e refs/remotes/origin/master diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/heads/master b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/heads/master new file mode 100644 index 000000000..a70ff80c0 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/heads/master @@ -0,0 +1 @@ +42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/remotes/origin/HEAD b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/remotes/origin/HEAD new file mode 100644 index 000000000..6efe28fff --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/modules/blah/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleAdd/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleAdd/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleAdd/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/5f/77fb3622a1035782a7dacc0cca12e674066b9e b/test/integration/submoduleAdd/expected/.git_keep/objects/5f/77fb3622a1035782a7dacc0cca12e674066b9e new file mode 100644 index 000000000..bc8326e0b Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/5f/77fb3622a1035782a7dacc0cca12e674066b9e differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/6d/e70e35394a99cc437d1bc70b0852b70c5bb03d b/test/integration/submoduleAdd/expected/.git_keep/objects/6d/e70e35394a99cc437d1bc70b0852b70c5bb03d new file mode 100644 index 000000000..8545bdc31 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/6d/e70e35394a99cc437d1bc70b0852b70c5bb03d differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleAdd/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleAdd/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleAdd/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb b/test/integration/submoduleAdd/expected/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb new file mode 100644 index 000000000..c4d570c9d Binary files /dev/null and b/test/integration/submoduleAdd/expected/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb differ diff --git a/test/integration/submoduleAdd/expected/.git_keep/refs/heads/master b/test/integration/submoduleAdd/expected/.git_keep/refs/heads/master new file mode 100644 index 000000000..d41df026f --- /dev/null +++ b/test/integration/submoduleAdd/expected/.git_keep/refs/heads/master @@ -0,0 +1 @@ +6de70e35394a99cc437d1bc70b0852b70c5bb03d diff --git a/test/integration/submoduleAdd/expected/.gitmodules_keep b/test/integration/submoduleAdd/expected/.gitmodules_keep new file mode 100644 index 000000000..b97660aff --- /dev/null +++ b/test/integration/submoduleAdd/expected/.gitmodules_keep @@ -0,0 +1,3 @@ +[submodule "blah"] + path = haha + url = ../other_repo diff --git a/test/integration/submoduleAdd/expected/haha/.git_keep b/test/integration/submoduleAdd/expected/haha/.git_keep new file mode 100644 index 000000000..a12aca648 --- /dev/null +++ b/test/integration/submoduleAdd/expected/haha/.git_keep @@ -0,0 +1 @@ +gitdir: ../.git/modules/blah diff --git a/test/integration/submoduleAdd/expected/haha/myfile1 b/test/integration/submoduleAdd/expected/haha/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleAdd/expected/haha/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleAdd/expected/haha/myfile2 b/test/integration/submoduleAdd/expected/haha/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleAdd/expected/haha/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleAdd/expected/myfile1 b/test/integration/submoduleAdd/expected/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleAdd/expected/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleAdd/expected/myfile2 b/test/integration/submoduleAdd/expected/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleAdd/expected/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleAdd/recording.json b/test/integration/submoduleAdd/recording.json new file mode 100644 index 000000000..aba73bc1c --- /dev/null +++ b/test/integration/submoduleAdd/recording.json @@ -0,0 +1 @@ +{"KeyEvents":[{"Timestamp":1858,"Mod":0,"Key":256,"Ch":93},{"Timestamp":4332,"Mod":0,"Key":256,"Ch":110},{"Timestamp":5067,"Mod":0,"Key":256,"Ch":46},{"Timestamp":5188,"Mod":0,"Key":256,"Ch":46},{"Timestamp":5323,"Mod":0,"Key":256,"Ch":47},{"Timestamp":5532,"Mod":0,"Key":256,"Ch":111},{"Timestamp":5652,"Mod":0,"Key":256,"Ch":116},{"Timestamp":5743,"Mod":0,"Key":256,"Ch":104},{"Timestamp":5862,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5892,"Mod":0,"Key":256,"Ch":114},{"Timestamp":6102,"Mod":0,"Key":256,"Ch":95},{"Timestamp":6297,"Mod":0,"Key":256,"Ch":114},{"Timestamp":6312,"Mod":0,"Key":256,"Ch":101},{"Timestamp":6402,"Mod":0,"Key":256,"Ch":112},{"Timestamp":6432,"Mod":0,"Key":256,"Ch":111},{"Timestamp":6718,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7632,"Mod":0,"Key":127,"Ch":127},{"Timestamp":7966,"Mod":0,"Key":127,"Ch":127},{"Timestamp":7982,"Mod":0,"Key":127,"Ch":127},{"Timestamp":7998,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8015,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8031,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8049,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8065,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8081,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8097,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8113,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8129,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8146,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8162,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8178,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8195,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8212,"Mod":0,"Key":127,"Ch":127},{"Timestamp":8397,"Mod":0,"Key":256,"Ch":98},{"Timestamp":8578,"Mod":0,"Key":256,"Ch":108},{"Timestamp":8698,"Mod":0,"Key":256,"Ch":97},{"Timestamp":8787,"Mod":0,"Key":256,"Ch":104},{"Timestamp":9012,"Mod":0,"Key":13,"Ch":13},{"Timestamp":9493,"Mod":0,"Key":127,"Ch":127},{"Timestamp":9717,"Mod":0,"Key":127,"Ch":127},{"Timestamp":9868,"Mod":0,"Key":127,"Ch":127},{"Timestamp":9973,"Mod":0,"Key":127,"Ch":127},{"Timestamp":10168,"Mod":0,"Key":256,"Ch":104},{"Timestamp":10228,"Mod":0,"Key":256,"Ch":97},{"Timestamp":10257,"Mod":0,"Key":256,"Ch":104},{"Timestamp":10393,"Mod":0,"Key":256,"Ch":97},{"Timestamp":10752,"Mod":0,"Key":13,"Ch":13},{"Timestamp":12612,"Mod":0,"Key":256,"Ch":91},{"Timestamp":13543,"Mod":0,"Key":256,"Ch":99},{"Timestamp":13797,"Mod":0,"Key":256,"Ch":116},{"Timestamp":13857,"Mod":0,"Key":256,"Ch":101},{"Timestamp":14037,"Mod":0,"Key":256,"Ch":115},{"Timestamp":14081,"Mod":0,"Key":256,"Ch":116},{"Timestamp":14368,"Mod":0,"Key":13,"Ch":13},{"Timestamp":15312,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":36}]} \ No newline at end of file diff --git a/test/integration/submoduleAdd/setup.sh b/test/integration/submoduleAdd/setup.sh new file mode 100644 index 000000000..b5dc60ab7 --- /dev/null +++ b/test/integration/submoduleAdd/setup.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +cd $1 + +export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" +export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" + +git init + +git config user.email "CI@example.com" +git config user.name "CI" + +echo test1 > myfile1 +git add . +git commit -am "myfile1" +echo test2 > myfile2 +git add . +git commit -am "myfile2" + +cd .. +git clone --bare ./actual other_repo +cd actual diff --git a/test/integration/submoduleAdd/test.json b/test/integration/submoduleAdd/test.json new file mode 100644 index 000000000..d937c5747 --- /dev/null +++ b/test/integration/submoduleAdd/test.json @@ -0,0 +1,4 @@ +{ + "description": "Add submodule", + "speed": 5 +} diff --git a/test/integration/submoduleEnter/expected/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleEnter/expected/.git_keep/COMMIT_EDITMSG new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/COMMIT_EDITMSG @@ -0,0 +1 @@ +test diff --git a/test/integration/submoduleEnter/expected/.git_keep/FETCH_HEAD b/test/integration/submoduleEnter/expected/.git_keep/FETCH_HEAD new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/submoduleEnter/expected/.git_keep/HEAD b/test/integration/submoduleEnter/expected/.git_keep/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/config b/test/integration/submoduleEnter/expected/.git_keep/config new file mode 100644 index 000000000..6806f15bd --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + email = CI@example.com + name = CI +[submodule "other_repo"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/other_repo + active = true diff --git a/test/integration/submoduleEnter/expected/.git_keep/description b/test/integration/submoduleEnter/expected/.git_keep/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleEnter/expected/.git_keep/index b/test/integration/submoduleEnter/expected/.git_keep/index new file mode 100644 index 000000000..588f51460 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/index differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/info/exclude b/test/integration/submoduleEnter/expected/.git_keep/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleEnter/expected/.git_keep/logs/HEAD b/test/integration/submoduleEnter/expected/.git_keep/logs/HEAD new file mode 100644 index 000000000..123fc35c9 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/logs/HEAD @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 CI 1534792759 +0100 commit: myfile3 +fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 e1eb418c0ff98940d4ea817eebcff5dcdde645ce CI 1534792759 +0100 commit: add submodule +e1eb418c0ff98940d4ea817eebcff5dcdde645ce c83cc777cf98a8c0f3c0995d7c1b21db92a71c66 CI 1643370762 +1100 commit: test diff --git a/test/integration/submoduleEnter/expected/.git_keep/logs/refs/heads/master b/test/integration/submoduleEnter/expected/.git_keep/logs/refs/heads/master new file mode 100644 index 000000000..123fc35c9 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/logs/refs/heads/master @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 CI 1534792759 +0100 commit: myfile3 +fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 e1eb418c0ff98940d4ea817eebcff5dcdde645ce CI 1534792759 +0100 commit: add submodule +e1eb418c0ff98940d4ea817eebcff5dcdde645ce c83cc777cf98a8c0f3c0995d7c1b21db92a71c66 CI 1643370762 +1100 commit: test diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/HEAD b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/ORIG_HEAD b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/ORIG_HEAD new file mode 100644 index 000000000..a70ff80c0 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/ORIG_HEAD @@ -0,0 +1 @@ +42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/config b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/config new file mode 100644 index 000000000..153285317 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/config @@ -0,0 +1,14 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true + worktree = ../../../other_repo +[remote "origin"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/other_repo + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/description b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/index b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/index new file mode 100644 index 000000000..385fd7bf9 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/index differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/info/exclude b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/HEAD b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/HEAD new file mode 100644 index 000000000..149d30cef --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/HEAD @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/other_repo +fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1643370757 +1100 rebase -i (start): checkout 42530e986dbb65877ed8d61ca0c816e425e5c62e +42530e986dbb65877ed8d61ca0c816e425e5c62e 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1643370757 +1100 rebase -i (finish): returning to refs/heads/master +42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370757 +1100 rebase -i (start): checkout a50a5125768001a3ea263ffb7cafbc421a508153 +a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370757 +1100 rebase -i (finish): returning to refs/heads/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/heads/master b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/heads/master new file mode 100644 index 000000000..b88258014 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/other_repo +fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1643370757 +1100 rebase -i (finish): refs/heads/master onto 42530e986dbb65877ed8d61ca0c816e425e5c62e +42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370757 +1100 rebase -i (finish): refs/heads/master onto a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD new file mode 100644 index 000000000..d08b838c1 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/other_repo diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c new file mode 100644 index 000000000..56590efa1 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 new file mode 100644 index 000000000..95d1a3bc9 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 @@ -0,0 +1,2 @@ +xK +0@] L&PDH&S,4z{{㭵k¥":!(gLR*o!($` =:8Fa-bJ-gdQN-Dwn'=C>xkwm\NzNu3W;/x9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/packed-refs b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/packed-refs new file mode 100644 index 000000000..ef4e386a6 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled sorted +fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 refs/remotes/origin/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/heads/master b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/heads/master new file mode 100644 index 000000000..ab99dc85b --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/heads/master @@ -0,0 +1 @@ +a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD new file mode 100644 index 000000000..6efe28fff --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleEnter/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/10/7f435787895be1068f01326df55c355a9d29b1 b/test/integration/submoduleEnter/expected/.git_keep/objects/10/7f435787895be1068f01326df55c355a9d29b1 new file mode 100644 index 000000000..199553fa6 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/10/7f435787895be1068f01326df55c355a9d29b1 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleEnter/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleEnter/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff new file mode 100644 index 000000000..5bfb0cefc Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleEnter/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/59/a9aee220657762e2d1c60799a0f5b03137d906 b/test/integration/submoduleEnter/expected/.git_keep/objects/59/a9aee220657762e2d1c60799a0f5b03137d906 new file mode 100644 index 000000000..e60d17459 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/59/a9aee220657762e2d1c60799a0f5b03137d906 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c b/test/integration/submoduleEnter/expected/.git_keep/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c new file mode 100644 index 000000000..56590efa1 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleEnter/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleEnter/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleEnter/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleEnter/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/c8/3cc777cf98a8c0f3c0995d7c1b21db92a71c66 b/test/integration/submoduleEnter/expected/.git_keep/objects/c8/3cc777cf98a8c0f3c0995d7c1b21db92a71c66 new file mode 100644 index 000000000..7da492489 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/objects/c8/3cc777cf98a8c0f3c0995d7c1b21db92a71c66 @@ -0,0 +1,2 @@ +xK +0FaYE".#?([jo NYz ͑c4oֈ>D`r&RHu՚6#[Z!Z)riMjJJq_6}6_M}}T~1HuP?"9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce b/test/integration/submoduleEnter/expected/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce new file mode 100644 index 000000000..9a2e552b8 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce @@ -0,0 +1,4 @@ +xK +0@]d29 "tcL +-5ox^7U,,DCJ` :RafMjɒ+KuWZȲd +Nl0pƇ~^`)3ZDsc럹ROm)xkwm\NzNu3W;/x9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/.git_keep/refs/heads/master b/test/integration/submoduleEnter/expected/.git_keep/refs/heads/master new file mode 100644 index 000000000..d109221f5 --- /dev/null +++ b/test/integration/submoduleEnter/expected/.git_keep/refs/heads/master @@ -0,0 +1 @@ +c83cc777cf98a8c0f3c0995d7c1b21db92a71c66 diff --git a/test/integration/submoduleEnter/expected/.gitmodules_keep b/test/integration/submoduleEnter/expected/.gitmodules_keep new file mode 100644 index 000000000..2b864257b --- /dev/null +++ b/test/integration/submoduleEnter/expected/.gitmodules_keep @@ -0,0 +1,3 @@ +[submodule "other_repo"] + path = other_repo + url = ../other_repo diff --git a/test/integration/submoduleEnter/expected/myfile1 b/test/integration/submoduleEnter/expected/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleEnter/expected/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleEnter/expected/myfile2 b/test/integration/submoduleEnter/expected/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleEnter/expected/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleEnter/expected/myfile3 b/test/integration/submoduleEnter/expected/myfile3 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleEnter/expected/myfile3 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleEnter/expected/other_repo/.git_keep b/test/integration/submoduleEnter/expected/other_repo/.git_keep new file mode 100644 index 000000000..32e5ae2e6 --- /dev/null +++ b/test/integration/submoduleEnter/expected/other_repo/.git_keep @@ -0,0 +1 @@ +gitdir: ../.git/modules/other_repo diff --git a/test/integration/submoduleEnter/expected/other_repo/myfile1 b/test/integration/submoduleEnter/expected/other_repo/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleEnter/expected/other_repo/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleEnter/recording.json b/test/integration/submoduleEnter/recording.json new file mode 100644 index 000000000..568b008b0 --- /dev/null +++ b/test/integration/submoduleEnter/recording.json @@ -0,0 +1 @@ +{"KeyEvents":[{"Timestamp":737,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1306,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1937,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2162,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2462,"Mod":0,"Key":256,"Ch":100},{"Timestamp":2687,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3049,"Mod":0,"Key":256,"Ch":100},{"Timestamp":3242,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3862,"Mod":0,"Key":27,"Ch":0},{"Timestamp":5177,"Mod":0,"Key":256,"Ch":91},{"Timestamp":6272,"Mod":0,"Key":256,"Ch":32},{"Timestamp":6752,"Mod":0,"Key":256,"Ch":99},{"Timestamp":7007,"Mod":0,"Key":256,"Ch":116},{"Timestamp":7051,"Mod":0,"Key":256,"Ch":101},{"Timestamp":7232,"Mod":0,"Key":256,"Ch":115},{"Timestamp":7276,"Mod":0,"Key":256,"Ch":116},{"Timestamp":7547,"Mod":0,"Key":13,"Ch":13},{"Timestamp":8251,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleEnter/setup.sh b/test/integration/submoduleEnter/setup.sh new file mode 100644 index 000000000..2f876d8ae --- /dev/null +++ b/test/integration/submoduleEnter/setup.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +cd $1 + +export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" +export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" + +git init + +git config user.email "CI@example.com" +git config user.name "CI" + +echo test1 > myfile1 +git add . +git commit -am "myfile1" +echo test2 > myfile2 +git add . +git commit -am "myfile2" +echo test2 > myfile3 +git add . +git commit -am "myfile3" + +cd .. +git clone --bare ./actual other_repo +cd actual + +git submodule add ../other_repo +git commit -am "add submodule" diff --git a/test/integration/submoduleEnter/test.json b/test/integration/submoduleEnter/test.json new file mode 100644 index 000000000..7bc6ff8ba --- /dev/null +++ b/test/integration/submoduleEnter/test.json @@ -0,0 +1,4 @@ +{ + "description": "Add submodule and enter. We enter the submodule, remove a couple of commits, and then stage the change in the parent repo", + "speed": 5 +} diff --git a/test/integration/submoduleRemove/expected/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleRemove/expected/.git_keep/COMMIT_EDITMSG new file mode 100644 index 000000000..5b256d7d3 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/COMMIT_EDITMSG @@ -0,0 +1 @@ +remove submodule diff --git a/test/integration/submoduleRemove/expected/.git_keep/FETCH_HEAD b/test/integration/submoduleRemove/expected/.git_keep/FETCH_HEAD new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/submoduleRemove/expected/.git_keep/HEAD b/test/integration/submoduleRemove/expected/.git_keep/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleRemove/expected/.git_keep/config b/test/integration/submoduleRemove/expected/.git_keep/config new file mode 100644 index 000000000..8ae104545 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/config @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + email = CI@example.com + name = CI diff --git a/test/integration/submoduleRemove/expected/.git_keep/description b/test/integration/submoduleRemove/expected/.git_keep/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleRemove/expected/.git_keep/index b/test/integration/submoduleRemove/expected/.git_keep/index new file mode 100644 index 000000000..5a4c6431f Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/index differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/info/exclude b/test/integration/submoduleRemove/expected/.git_keep/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleRemove/expected/.git_keep/logs/HEAD b/test/integration/submoduleRemove/expected/.git_keep/logs/HEAD new file mode 100644 index 000000000..a38da0237 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/logs/HEAD @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule +9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 40f121d7563ed318d461996b8d84e2ec8632687e CI 1643370773 +1100 commit: remove submodule diff --git a/test/integration/submoduleRemove/expected/.git_keep/logs/refs/heads/master b/test/integration/submoduleRemove/expected/.git_keep/logs/refs/heads/master new file mode 100644 index 000000000..a38da0237 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/logs/refs/heads/master @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule +9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 40f121d7563ed318d461996b8d84e2ec8632687e CI 1643370773 +1100 commit: remove submodule diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleRemove/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleRemove/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleRemove/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff new file mode 100644 index 000000000..5bfb0cefc Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 b/test/integration/submoduleRemove/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 new file mode 100644 index 000000000..acdda888b Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/40/f121d7563ed318d461996b8d84e2ec8632687e b/test/integration/submoduleRemove/expected/.git_keep/objects/40/f121d7563ed318d461996b8d84e2ec8632687e new file mode 100644 index 000000000..3fed8203a --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/objects/40/f121d7563ed318d461996b8d84e2ec8632687e @@ -0,0 +1,2 @@ +xK +0@] 2U1LPhLx|{/ZCEtAgYfo#h"RaF:g,1Y5%#' &@(.:>S(ƣu=:wR]9Vo6BVn!Kmk"!>] \ No newline at end of file diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleRemove/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 b/test/integration/submoduleRemove/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 new file mode 100644 index 000000000..d63e62eec Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleRemove/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleRemove/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleRemove/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/test/integration/submoduleRemove/expected/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 new file mode 100644 index 000000000..711223894 Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/objects/f1/43043bb53b17b5727a43b6cfbb1a8d1f5a222d b/test/integration/submoduleRemove/expected/.git_keep/objects/f1/43043bb53b17b5727a43b6cfbb1a8d1f5a222d new file mode 100644 index 000000000..8673162cc Binary files /dev/null and b/test/integration/submoduleRemove/expected/.git_keep/objects/f1/43043bb53b17b5727a43b6cfbb1a8d1f5a222d differ diff --git a/test/integration/submoduleRemove/expected/.git_keep/refs/heads/master b/test/integration/submoduleRemove/expected/.git_keep/refs/heads/master new file mode 100644 index 000000000..0c4653c44 --- /dev/null +++ b/test/integration/submoduleRemove/expected/.git_keep/refs/heads/master @@ -0,0 +1 @@ +40f121d7563ed318d461996b8d84e2ec8632687e diff --git a/test/integration/submoduleRemove/expected/.gitmodules_keep b/test/integration/submoduleRemove/expected/.gitmodules_keep new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/submoduleRemove/expected/myfile1 b/test/integration/submoduleRemove/expected/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleRemove/expected/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleRemove/expected/myfile2 b/test/integration/submoduleRemove/expected/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleRemove/expected/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleRemove/recording.json b/test/integration/submoduleRemove/recording.json new file mode 100644 index 000000000..ad22a348d --- /dev/null +++ b/test/integration/submoduleRemove/recording.json @@ -0,0 +1 @@ +{"KeyEvents":[{"Timestamp":912,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1280,"Mod":0,"Key":256,"Ch":100},{"Timestamp":1696,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2544,"Mod":0,"Key":256,"Ch":91},{"Timestamp":2984,"Mod":0,"Key":256,"Ch":99},{"Timestamp":3680,"Mod":0,"Key":256,"Ch":114},{"Timestamp":3736,"Mod":0,"Key":256,"Ch":101},{"Timestamp":3824,"Mod":0,"Key":256,"Ch":109},{"Timestamp":3872,"Mod":0,"Key":256,"Ch":111},{"Timestamp":3944,"Mod":0,"Key":256,"Ch":118},{"Timestamp":3976,"Mod":0,"Key":256,"Ch":101},{"Timestamp":4064,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4152,"Mod":0,"Key":256,"Ch":115},{"Timestamp":4248,"Mod":0,"Key":256,"Ch":117},{"Timestamp":4320,"Mod":0,"Key":256,"Ch":98},{"Timestamp":4560,"Mod":0,"Key":256,"Ch":109},{"Timestamp":4632,"Mod":0,"Key":256,"Ch":111},{"Timestamp":4720,"Mod":0,"Key":256,"Ch":100},{"Timestamp":4824,"Mod":0,"Key":256,"Ch":117},{"Timestamp":4880,"Mod":0,"Key":256,"Ch":108},{"Timestamp":4944,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5152,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5648,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleRemove/setup.sh b/test/integration/submoduleRemove/setup.sh new file mode 100644 index 000000000..250092ed1 --- /dev/null +++ b/test/integration/submoduleRemove/setup.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +cd $1 + +export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" +export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" + +git init + +git config user.email "CI@example.com" +git config user.name "CI" + +echo test1 > myfile1 +git add . +git commit -am "myfile1" +echo test2 > myfile2 +git add . +git commit -am "myfile2" + +cd .. +git clone --bare ./actual other_repo +cd actual + +git submodule add ../other_repo +git commit -am "add submodule" diff --git a/test/integration/submoduleRemove/test.json b/test/integration/submoduleRemove/test.json new file mode 100644 index 000000000..87daa5360 --- /dev/null +++ b/test/integration/submoduleRemove/test.json @@ -0,0 +1,4 @@ +{ + "description": "Remove a submodule", + "speed": 20 +} diff --git a/test/integration/submoduleReset/config/config.yml b/test/integration/submoduleReset/config/config.yml new file mode 100644 index 000000000..991cda34b --- /dev/null +++ b/test/integration/submoduleReset/config/config.yml @@ -0,0 +1,6 @@ +disableStartupPopups: true +customCommands: + - key: 'N' + description: 'Add file' + context: 'files' + command: 'echo "haha" > output.txt' diff --git a/test/integration/submoduleReset/expected/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleReset/expected/.git_keep/COMMIT_EDITMSG new file mode 100644 index 000000000..ad3cdfdd1 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/COMMIT_EDITMSG @@ -0,0 +1 @@ +add submodule diff --git a/test/integration/submoduleReset/expected/.git_keep/FETCH_HEAD b/test/integration/submoduleReset/expected/.git_keep/FETCH_HEAD new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/submoduleReset/expected/.git_keep/HEAD b/test/integration/submoduleReset/expected/.git_keep/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/submoduleReset/expected/.git_keep/config b/test/integration/submoduleReset/expected/.git_keep/config new file mode 100644 index 000000000..30e8aeba3 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + email = CI@example.com + name = CI +[submodule "other_repo"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/other_repo + active = true diff --git a/test/integration/submoduleReset/expected/.git_keep/description b/test/integration/submoduleReset/expected/.git_keep/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleReset/expected/.git_keep/index b/test/integration/submoduleReset/expected/.git_keep/index new file mode 100644 index 000000000..8997e61f4 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/index differ diff --git a/test/integration/submoduleReset/expected/.git_keep/info/exclude b/test/integration/submoduleReset/expected/.git_keep/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleReset/expected/.git_keep/logs/HEAD b/test/integration/submoduleReset/expected/.git_keep/logs/HEAD new file mode 100644 index 000000000..d10fa88d0 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/logs/HEAD @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule diff --git a/test/integration/submoduleReset/expected/.git_keep/logs/refs/heads/master b/test/integration/submoduleReset/expected/.git_keep/logs/refs/heads/master new file mode 100644 index 000000000..d10fa88d0 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 +42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/HEAD b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/HEAD new file mode 100644 index 000000000..a70ff80c0 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/HEAD @@ -0,0 +1 @@ +42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/ORIG_HEAD b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/ORIG_HEAD new file mode 100644 index 000000000..ab99dc85b --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/ORIG_HEAD @@ -0,0 +1 @@ +a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/config b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/config new file mode 100644 index 000000000..3ffcf6005 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/config @@ -0,0 +1,14 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true + worktree = ../../../other_repo +[remote "origin"] + url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/other_repo + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/description b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/index b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/index new file mode 100644 index 000000000..407447e94 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/index differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/info/exclude b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/info/exclude @@ -0,0 +1,7 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +.DS_Store diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/HEAD b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/HEAD new file mode 100644 index 000000000..2d343313b --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/HEAD @@ -0,0 +1,5 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/other_repo +42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370783 +1100 rebase -i (start): checkout a50a5125768001a3ea263ffb7cafbc421a508153 +a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370783 +1100 rebase -i (finish): returning to refs/heads/master +a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370791 +1100 reset: moving to HEAD +a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1643370791 +1100 checkout: moving from master to 42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/heads/master b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/heads/master new file mode 100644 index 000000000..227bcfcb6 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/heads/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/other_repo +42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1643370783 +1100 rebase -i (finish): refs/heads/master onto a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD new file mode 100644 index 000000000..c0c3c89d8 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/other_repo diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/stash b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/stash new file mode 100644 index 000000000..4d43eb072 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/logs/refs/stash @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 f35aba17e85e3fe18f7b01c0f65306c9289c482e Jesse Duffield 1643370791 +1100 WIP on master: a50a512 myfile1 diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d new file mode 100644 index 000000000..a908456d8 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 new file mode 100644 index 000000000..adf64119a Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/5a/d28e22767f979da2c198dc6c1003b25964e3da b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/5a/d28e22767f979da2c198dc6c1003b25964e3da new file mode 100644 index 000000000..a49384ff6 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/5a/d28e22767f979da2c198dc6c1003b25964e3da differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/84/69b6d9b0a33be075f9e0df61c5a3ebba3ecfd2 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/84/69b6d9b0a33be075f9e0df61c5a3ebba3ecfd2 new file mode 100644 index 000000000..50202f0c4 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/84/69b6d9b0a33be075f9e0df61c5a3ebba3ecfd2 @@ -0,0 +1,2 @@ +xK E771 +$ܽmssC-%wBLbR[IILV<([pnKJ1(.PpģvW-S]xSGjP'(8NqM}J \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/9d/13001fc1d98cd178f9e604f6f2c2e52794079e b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/9d/13001fc1d98cd178f9e604f6f2c2e52794079e new file mode 100644 index 000000000..8700d75ac Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/9d/13001fc1d98cd178f9e604f6f2c2e52794079e differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/f3/5aba17e85e3fe18f7b01c0f65306c9289c482e b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/f3/5aba17e85e3fe18f7b01c0f65306c9289c482e new file mode 100644 index 000000000..e48c17184 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/objects/f3/5aba17e85e3fe18f7b01c0f65306c9289c482e differ diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/packed-refs b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/packed-refs new file mode 100644 index 000000000..2991aad64 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled sorted +42530e986dbb65877ed8d61ca0c816e425e5c62e refs/remotes/origin/master diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/heads/master b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/heads/master new file mode 100644 index 000000000..ab99dc85b --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/heads/master @@ -0,0 +1 @@ +a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD new file mode 100644 index 000000000..6efe28fff --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/stash b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/stash new file mode 100644 index 000000000..4a83bf1dd --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/modules/other_repo/refs/stash @@ -0,0 +1 @@ +f35aba17e85e3fe18f7b01c0f65306c9289c482e diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleReset/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 new file mode 100644 index 000000000..7f2ebf4ee Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/submoduleReset/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 000000000..f74bf2335 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleReset/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff new file mode 100644 index 000000000..5bfb0cefc Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 b/test/integration/submoduleReset/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 new file mode 100644 index 000000000..acdda888b Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleReset/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e new file mode 100644 index 000000000..64d20cb1e Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 b/test/integration/submoduleReset/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 new file mode 100644 index 000000000..d63e62eec Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleReset/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 new file mode 100644 index 000000000..5dd5f3236 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 @@ -0,0 +1,2 @@ +xM +0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleReset/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 000000000..285df3e5f Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleReset/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 new file mode 100644 index 000000000..96d2e71a6 Binary files /dev/null and b/test/integration/submoduleReset/expected/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 differ diff --git a/test/integration/submoduleReset/expected/.git_keep/refs/heads/master b/test/integration/submoduleReset/expected/.git_keep/refs/heads/master new file mode 100644 index 000000000..ad2d893d7 --- /dev/null +++ b/test/integration/submoduleReset/expected/.git_keep/refs/heads/master @@ -0,0 +1 @@ +9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 diff --git a/test/integration/submoduleReset/expected/.gitmodules_keep b/test/integration/submoduleReset/expected/.gitmodules_keep new file mode 100644 index 000000000..2b864257b --- /dev/null +++ b/test/integration/submoduleReset/expected/.gitmodules_keep @@ -0,0 +1,3 @@ +[submodule "other_repo"] + path = other_repo + url = ../other_repo diff --git a/test/integration/submoduleReset/expected/myfile1 b/test/integration/submoduleReset/expected/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleReset/expected/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleReset/expected/myfile2 b/test/integration/submoduleReset/expected/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleReset/expected/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleReset/expected/other_repo/.git_keep b/test/integration/submoduleReset/expected/other_repo/.git_keep new file mode 100644 index 000000000..32e5ae2e6 --- /dev/null +++ b/test/integration/submoduleReset/expected/other_repo/.git_keep @@ -0,0 +1 @@ +gitdir: ../.git/modules/other_repo diff --git a/test/integration/submoduleReset/expected/other_repo/myfile1 b/test/integration/submoduleReset/expected/other_repo/myfile1 new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/integration/submoduleReset/expected/other_repo/myfile1 @@ -0,0 +1 @@ +test1 diff --git a/test/integration/submoduleReset/expected/other_repo/myfile2 b/test/integration/submoduleReset/expected/other_repo/myfile2 new file mode 100644 index 000000000..180cf8328 --- /dev/null +++ b/test/integration/submoduleReset/expected/other_repo/myfile2 @@ -0,0 +1 @@ +test2 diff --git a/test/integration/submoduleReset/recording.json b/test/integration/submoduleReset/recording.json new file mode 100644 index 000000000..2b272d7f5 --- /dev/null +++ b/test/integration/submoduleReset/recording.json @@ -0,0 +1 @@ +{"KeyEvents":[{"Timestamp":653,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1685,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2749,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2893,"Mod":0,"Key":259,"Ch":0},{"Timestamp":3229,"Mod":0,"Key":256,"Ch":100},{"Timestamp":3661,"Mod":0,"Key":13,"Ch":13},{"Timestamp":4069,"Mod":0,"Key":260,"Ch":0},{"Timestamp":4189,"Mod":0,"Key":260,"Ch":0},{"Timestamp":5180,"Mod":0,"Key":256,"Ch":78},{"Timestamp":6508,"Mod":0,"Key":256,"Ch":32},{"Timestamp":7311,"Mod":0,"Key":27,"Ch":0},{"Timestamp":8212,"Mod":0,"Key":256,"Ch":91},{"Timestamp":10268,"Mod":0,"Key":256,"Ch":100},{"Timestamp":12165,"Mod":0,"Key":13,"Ch":13},{"Timestamp":13741,"Mod":0,"Key":256,"Ch":93},{"Timestamp":14317,"Mod":0,"Key":13,"Ch":13},{"Timestamp":16645,"Mod":0,"Key":259,"Ch":0},{"Timestamp":16805,"Mod":0,"Key":259,"Ch":0},{"Timestamp":17005,"Mod":0,"Key":259,"Ch":0},{"Timestamp":18588,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleReset/setup.sh b/test/integration/submoduleReset/setup.sh new file mode 100644 index 000000000..250092ed1 --- /dev/null +++ b/test/integration/submoduleReset/setup.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +cd $1 + +export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" +export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" + +git init + +git config user.email "CI@example.com" +git config user.name "CI" + +echo test1 > myfile1 +git add . +git commit -am "myfile1" +echo test2 > myfile2 +git add . +git commit -am "myfile2" + +cd .. +git clone --bare ./actual other_repo +cd actual + +git submodule add ../other_repo +git commit -am "add submodule" diff --git a/test/integration/submoduleReset/test.json b/test/integration/submoduleReset/test.json new file mode 100644 index 000000000..ccac209e4 --- /dev/null +++ b/test/integration/submoduleReset/test.json @@ -0,0 +1,4 @@ +{ + "description": "After making some changes in a submodule, we reset the submodule from the parent repo", + "speed": 10 +}