From 562ce3f5e6968d2e3cb189e8bb327f2ab6cf79d3 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 5 May 2022 11:50:46 +0200 Subject: [PATCH] Move most code into a 'common' package The 'cli' and the 'daemon' will need to share this code. --- author.go => common/author.go | 2 +- autosync.go => common/autosync.go | 4 ++-- commit.go => common/commit.go | 2 +- commit_test.go => common/commit_test.go | 2 +- config.go => common/config.go | 2 +- fetch.go => common/fetch.go | 2 +- fetch_test.go => common/fetch_test.go | 2 +- ignore.go => common/ignore.go | 2 +- ignore_test.go => common/ignore_test.go | 2 +- push.go => common/push.go | 2 +- rebase.go => common/rebase.go | 2 +- rebase_test.go => common/rebase_test.go | 2 +- {testdata => common/testdata}/ignore/.gitignore | 0 {testdata => common/testdata}/ignore/.gitted/HEAD | 0 .../testdata}/ignore/.gitted/branches/.gitignore | 0 {testdata => common/testdata}/ignore/.gitted/config | 0 .../testdata}/ignore/.gitted/description | 0 {testdata => common/testdata}/ignore/.gitted/index | Bin .../testdata}/ignore/.gitted/info/refs | 0 ...ack-6084461925de24b5672557d115a4eff8b2d92326.idx | Bin ...ck-6084461925de24b5672557d115a4eff8b2d92326.pack | Bin .../testdata}/ignore/.gitted/packed-refs | 0 .../testdata}/ignore/.gitted/refs/heads/.gitignore | 0 .../testdata}/ignore/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/ignore/1.md | 0 .../multiple_file_change/.gitted/COMMIT_EDITMSG | 0 .../testdata}/multiple_file_change/.gitted/HEAD | 0 .../.gitted/branches/.gitignore | 0 .../testdata}/multiple_file_change/.gitted/config | 0 .../multiple_file_change/.gitted/description | 0 .../testdata}/multiple_file_change/.gitted/index | Bin .../multiple_file_change/.gitted/info/refs | 0 .../multiple_file_change/.gitted/logs/HEAD | 0 .../.gitted/logs/refs/heads/master | 0 .../.gitted/objects/info/commit-graph | Bin .../multiple_file_change/.gitted/objects/info/packs | 0 ...ack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx | Bin ...ck-8bd23478afc278bb9d444418db77fa24b756f8b8.pack | Bin .../multiple_file_change/.gitted/packed-refs | 0 .../.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/tags/.gitignore | 0 .../testdata}/multiple_file_change/1.md | 0 .../testdata}/multiple_file_change/dirA/2.md | 0 .../testdata}/multiple_file_change/dirB/3.md | 0 {testdata => common/testdata}/new_file/.gitted/HEAD | 0 .../testdata}/new_file/.gitted/branches/.gitignore | 0 .../testdata}/new_file/.gitted/config | 0 .../testdata}/new_file/.gitted/description | 0 .../testdata}/new_file/.gitted/index | Bin ...ack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx | Bin ...ck-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack | Bin .../testdata}/new_file/.gitted/packed-refs | 0 .../new_file/.gitted/refs/heads/.gitignore | 0 .../testdata}/new_file/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/new_file/1.md | 0 {testdata => common/testdata}/new_file/2.md | 0 .../testdata}/no_changes/.gitted/HEAD | 0 .../no_changes/.gitted/branches/.gitignore | 0 .../testdata}/no_changes/.gitted/config | 0 .../testdata}/no_changes/.gitted/description | 0 .../testdata}/no_changes/.gitted/index | Bin ...ack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx | Bin ...ck-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack | Bin .../testdata}/no_changes/.gitted/packed-refs | 0 .../no_changes/.gitted/refs/heads/.gitignore | 0 .../no_changes/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/no_changes/1.md | 0 .../testdata}/one_file_change/.gitted/HEAD | 0 .../one_file_change/.gitted/branches/.gitignore | 0 .../testdata}/one_file_change/.gitted/config | 0 .../testdata}/one_file_change/.gitted/description | 0 .../testdata}/one_file_change/.gitted/index | Bin ...ack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx | Bin ...ck-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack | Bin .../testdata}/one_file_change/.gitted/packed-refs | 0 .../one_file_change/.gitted/refs/heads/.gitignore | 0 .../one_file_change/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/one_file_change/1.md | 0 .../testdata}/rebase_both_commits/.gitted/HEAD | 0 .../rebase_both_commits/.gitted/branches/.gitignore | 0 .../testdata}/rebase_both_commits/.gitted/config | 0 .../rebase_both_commits/.gitted/description | 0 .../testdata}/rebase_both_commits/.gitted/index | Bin .../57/79561afa9d074ae8d20974861c54757429aca9 | Bin .../5b/2421e1ef4d7f32306709aab06b1a6c02294b30 | 0 .../b8/626c4cff2849624fb67f87cd0ad72b163671ad | Bin .../bb/42c22f4d5ce6083275b82e129a4b7868913015 | Bin .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin ...ack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx | Bin ...ck-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack | Bin .../rebase_both_commits/.gitted/packed-refs | 0 .../.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/tags/.gitignore | 0 .../testdata}/rebase_both_commits/1.md | 0 .../testdata}/rebase_both_commits/2.md | 0 .../rebase_both_commits_conflict/.gitted/HEAD | 0 .../.gitted/branches/.gitignore | 0 .../rebase_both_commits_conflict/.gitted/config | 0 .../.gitted/description | 0 .../rebase_both_commits_conflict/.gitted/index | Bin .../rebase_both_commits_conflict/.gitted/info/refs | 0 .../5b/2421e1ef4d7f32306709aab06b1a6c02294b30 | 0 .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin .../.gitted/objects/info/commit-graph | Bin .../.gitted/objects/info/packs | 0 ...ack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx | Bin ...ck-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack | Bin .../.gitted/packed-refs | 0 .../.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/tags/.gitignore | 0 .../testdata}/rebase_both_commits_conflict/1.md | 0 .../testdata}/rebase_both_commits_conflict/2.md | 0 .../testdata}/rebase_both_commits_conflict/3.md | 0 .../testdata}/rebase_local_commits/.gitted/HEAD | 0 .../.gitted/branches/.gitignore | 0 .../testdata}/rebase_local_commits/.gitted/config | 0 .../rebase_local_commits/.gitted/description | 0 .../testdata}/rebase_local_commits/.gitted/index | Bin .../rebase_local_commits/.gitted/info/refs | 0 ...ack-6ed5aab84549686dd1639003c49f7f7aede63325.idx | Bin ...ck-6ed5aab84549686dd1639003c49f7f7aede63325.pack | Bin .../rebase_local_commits/.gitted/packed-refs | 0 .../.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/tags/.gitignore | 0 .../testdata}/rebase_local_commits/1.md | 0 .../testdata}/rebase_local_commits/2.md | 0 .../testdata}/rebase_nothing/.gitted/FETCH_HEAD | 0 .../testdata}/rebase_nothing/.gitted/HEAD | 0 .../rebase_nothing/.gitted/branches/.gitignore | 0 .../testdata}/rebase_nothing/.gitted/config | 0 .../testdata}/rebase_nothing/.gitted/description | 0 .../testdata}/rebase_nothing/.gitted/index | Bin .../.gitted/logs/refs/remotes/origin/master | 0 ...ack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx | Bin ...ck-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack | Bin .../testdata}/rebase_nothing/.gitted/packed-refs | 0 .../rebase_nothing/.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/remotes/origin/master | 0 .../rebase_nothing/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/rebase_nothing/1.md | 0 .../testdata}/rebase_parent/.gitted/HEAD | 0 .../rebase_parent/.gitted/branches/.gitignore | 0 .../testdata}/rebase_parent/.gitted/config | 0 .../testdata}/rebase_parent/.gitted/description | 0 .../testdata}/rebase_parent/.gitted/index | Bin ...ack-0e97b284249125dd68802efc8e497badec0ab786.idx | Bin ...ck-0e97b284249125dd68802efc8e497badec0ab786.pack | Bin .../testdata}/rebase_parent/.gitted/packed-refs | 0 .../rebase_parent/.gitted/refs/heads/.gitignore | 0 .../rebase_parent/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/rebase_parent/1.md | 0 {testdata => common/testdata}/rebase_parent/3.md | 0 .../testdata}/rebase_remote_commits/.gitted/HEAD | 0 .../.gitted/branches/.gitignore | 0 .../testdata}/rebase_remote_commits/.gitted/config | 0 .../rebase_remote_commits/.gitted/description | 0 .../testdata}/rebase_remote_commits/.gitted/index | Bin .../rebase_remote_commits/.gitted/info/refs | 0 ...ack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx | Bin ...ck-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack | Bin .../rebase_remote_commits/.gitted/packed-refs | 0 .../.gitted/refs/heads/.gitignore | 0 .../.gitted/refs/tags/.gitignore | 0 .../testdata}/rebase_remote_commits/1.md | 0 .../testdata}/simple_fetch/.gitted/HEAD | 0 .../simple_fetch/.gitted/branches/.gitignore | 0 .../testdata}/simple_fetch/.gitted/config | 0 .../testdata}/simple_fetch/.gitted/description | 0 .../testdata}/simple_fetch/.gitted/index | Bin ...ack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx | Bin ...ck-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack | Bin .../testdata}/simple_fetch/.gitted/packed-refs | 0 .../simple_fetch/.gitted/refs/heads/.gitignore | 0 .../simple_fetch/.gitted/refs/tags/.gitignore | 0 {testdata => common/testdata}/simple_fetch/1.md | 0 watch.go => common/watch.go | 2 +- daemon.go | 11 ++++++----- main.go | 6 ++++-- 178 files changed, 24 insertions(+), 21 deletions(-) rename author.go => common/author.go (97%) rename autosync.go => common/autosync.go (90%) rename commit.go => common/commit.go (98%) rename commit_test.go => common/commit_test.go (99%) rename config.go => common/config.go (98%) rename fetch.go => common/fetch.go (96%) rename fetch_test.go => common/fetch_test.go (99%) rename ignore.go => common/ignore.go (98%) rename ignore_test.go => common/ignore_test.go (95%) rename push.go => common/push.go (96%) rename rebase.go => common/rebase.go (99%) rename rebase_test.go => common/rebase_test.go (99%) rename {testdata => common/testdata}/ignore/.gitignore (100%) rename {testdata => common/testdata}/ignore/.gitted/HEAD (100%) rename {testdata => common/testdata}/ignore/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/ignore/.gitted/config (100%) rename {testdata => common/testdata}/ignore/.gitted/description (100%) rename {testdata => common/testdata}/ignore/.gitted/index (100%) rename {testdata => common/testdata}/ignore/.gitted/info/refs (100%) rename {testdata => common/testdata}/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.idx (100%) rename {testdata => common/testdata}/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.pack (100%) rename {testdata => common/testdata}/ignore/.gitted/packed-refs (100%) rename {testdata => common/testdata}/ignore/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/ignore/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/ignore/1.md (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/COMMIT_EDITMSG (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/HEAD (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/config (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/description (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/index (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/info/refs (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/logs/HEAD (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/logs/refs/heads/master (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/objects/info/commit-graph (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/objects/info/packs (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.pack (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/packed-refs (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/multiple_file_change/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/multiple_file_change/1.md (100%) rename {testdata => common/testdata}/multiple_file_change/dirA/2.md (100%) rename {testdata => common/testdata}/multiple_file_change/dirB/3.md (100%) rename {testdata => common/testdata}/new_file/.gitted/HEAD (100%) rename {testdata => common/testdata}/new_file/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/new_file/.gitted/config (100%) rename {testdata => common/testdata}/new_file/.gitted/description (100%) rename {testdata => common/testdata}/new_file/.gitted/index (100%) rename {testdata => common/testdata}/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx (100%) rename {testdata => common/testdata}/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack (100%) rename {testdata => common/testdata}/new_file/.gitted/packed-refs (100%) rename {testdata => common/testdata}/new_file/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/new_file/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/new_file/1.md (100%) rename {testdata => common/testdata}/new_file/2.md (100%) rename {testdata => common/testdata}/no_changes/.gitted/HEAD (100%) rename {testdata => common/testdata}/no_changes/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/no_changes/.gitted/config (100%) rename {testdata => common/testdata}/no_changes/.gitted/description (100%) rename {testdata => common/testdata}/no_changes/.gitted/index (100%) rename {testdata => common/testdata}/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx (100%) rename {testdata => common/testdata}/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack (100%) rename {testdata => common/testdata}/no_changes/.gitted/packed-refs (100%) rename {testdata => common/testdata}/no_changes/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/no_changes/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/no_changes/1.md (100%) rename {testdata => common/testdata}/one_file_change/.gitted/HEAD (100%) rename {testdata => common/testdata}/one_file_change/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/one_file_change/.gitted/config (100%) rename {testdata => common/testdata}/one_file_change/.gitted/description (100%) rename {testdata => common/testdata}/one_file_change/.gitted/index (100%) rename {testdata => common/testdata}/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx (100%) rename {testdata => common/testdata}/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack (100%) rename {testdata => common/testdata}/one_file_change/.gitted/packed-refs (100%) rename {testdata => common/testdata}/one_file_change/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/one_file_change/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/one_file_change/1.md (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/config (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/description (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/index (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/57/79561afa9d074ae8d20974861c54757429aca9 (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/b8/626c4cff2849624fb67f87cd0ad72b163671ad (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/bb/42c22f4d5ce6083275b82e129a4b7868913015 (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits/1.md (100%) rename {testdata => common/testdata}/rebase_both_commits/2.md (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/config (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/description (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/index (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/info/refs (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/info/commit-graph (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/info/packs (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/1.md (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/2.md (100%) rename {testdata => common/testdata}/rebase_both_commits_conflict/3.md (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/config (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/description (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/index (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/info/refs (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.idx (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.pack (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_local_commits/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_local_commits/1.md (100%) rename {testdata => common/testdata}/rebase_local_commits/2.md (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/FETCH_HEAD (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/config (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/description (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/index (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/logs/refs/remotes/origin/master (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/refs/remotes/origin/master (100%) rename {testdata => common/testdata}/rebase_nothing/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_nothing/1.md (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/config (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/description (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/index (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.idx (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.pack (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_parent/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_parent/1.md (100%) rename {testdata => common/testdata}/rebase_parent/3.md (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/HEAD (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/config (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/description (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/index (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/info/refs (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/packed-refs (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/rebase_remote_commits/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/rebase_remote_commits/1.md (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/HEAD (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/branches/.gitignore (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/config (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/description (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/index (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/packed-refs (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/refs/heads/.gitignore (100%) rename {testdata => common/testdata}/simple_fetch/.gitted/refs/tags/.gitignore (100%) rename {testdata => common/testdata}/simple_fetch/1.md (100%) rename watch.go => common/watch.go (98%) diff --git a/author.go b/common/author.go similarity index 97% rename from author.go rename to common/author.go index fbe5b43..9908761 100644 --- a/author.go +++ b/common/author.go @@ -1,4 +1,4 @@ -package main +package common import ( "errors" diff --git a/autosync.go b/common/autosync.go similarity index 90% rename from autosync.go rename to common/autosync.go index d6af1b0..5db13ff 100644 --- a/autosync.go +++ b/common/autosync.go @@ -1,8 +1,8 @@ -package main +package common import "github.com/ztrue/tracerr" -func autoSync(repoPath string) error { +func AutoSync(repoPath string) error { var err error err = ensureGitAuthor(repoPath) if err != nil { diff --git a/commit.go b/common/commit.go similarity index 98% rename from commit.go rename to common/commit.go index 7f6b692..5a9d737 100644 --- a/commit.go +++ b/common/commit.go @@ -1,4 +1,4 @@ -package main +package common import ( "bytes" diff --git a/commit_test.go b/common/commit_test.go similarity index 99% rename from commit_test.go rename to common/commit_test.go index 1f4a43c..83804e9 100644 --- a/commit_test.go +++ b/common/commit_test.go @@ -1,4 +1,4 @@ -package main +package common import ( "io/ioutil" diff --git a/config.go b/common/config.go similarity index 98% rename from config.go rename to common/config.go index f194f14..9fb0089 100644 --- a/config.go +++ b/common/config.go @@ -1,4 +1,4 @@ -package main +package common import ( "encoding/json" diff --git a/fetch.go b/common/fetch.go similarity index 96% rename from fetch.go rename to common/fetch.go index 0237d8a..318d6ad 100644 --- a/fetch.go +++ b/common/fetch.go @@ -1,4 +1,4 @@ -package main +package common import ( "github.com/ztrue/tracerr" diff --git a/fetch_test.go b/common/fetch_test.go similarity index 99% rename from fetch_test.go rename to common/fetch_test.go index c6db43b..9f0c5e7 100644 --- a/fetch_test.go +++ b/common/fetch_test.go @@ -1,4 +1,4 @@ -package main +package common import ( "bytes" diff --git a/ignore.go b/common/ignore.go similarity index 98% rename from ignore.go rename to common/ignore.go index 37898f9..60ddded 100644 --- a/ignore.go +++ b/common/ignore.go @@ -1,4 +1,4 @@ -package main +package common import ( "path/filepath" diff --git a/ignore_test.go b/common/ignore_test.go similarity index 95% rename from ignore_test.go rename to common/ignore_test.go index f4ad166..f7b1ecc 100644 --- a/ignore_test.go +++ b/common/ignore_test.go @@ -1,4 +1,4 @@ -package main +package common import ( "testing" diff --git a/push.go b/common/push.go similarity index 96% rename from push.go rename to common/push.go index d45299e..43e578b 100644 --- a/push.go +++ b/common/push.go @@ -1,4 +1,4 @@ -package main +package common import ( "github.com/ztrue/tracerr" diff --git a/rebase.go b/common/rebase.go similarity index 99% rename from rebase.go rename to common/rebase.go index 4041421..e704090 100644 --- a/rebase.go +++ b/common/rebase.go @@ -1,4 +1,4 @@ -package main +package common import ( "errors" diff --git a/rebase_test.go b/common/rebase_test.go similarity index 99% rename from rebase_test.go rename to common/rebase_test.go index 336c8e5..2e28c48 100644 --- a/rebase_test.go +++ b/common/rebase_test.go @@ -1,4 +1,4 @@ -package main +package common import ( "testing" diff --git a/testdata/ignore/.gitignore b/common/testdata/ignore/.gitignore similarity index 100% rename from testdata/ignore/.gitignore rename to common/testdata/ignore/.gitignore diff --git a/testdata/ignore/.gitted/HEAD b/common/testdata/ignore/.gitted/HEAD similarity index 100% rename from testdata/ignore/.gitted/HEAD rename to common/testdata/ignore/.gitted/HEAD diff --git a/testdata/ignore/.gitted/branches/.gitignore b/common/testdata/ignore/.gitted/branches/.gitignore similarity index 100% rename from testdata/ignore/.gitted/branches/.gitignore rename to common/testdata/ignore/.gitted/branches/.gitignore diff --git a/testdata/ignore/.gitted/config b/common/testdata/ignore/.gitted/config similarity index 100% rename from testdata/ignore/.gitted/config rename to common/testdata/ignore/.gitted/config diff --git a/testdata/ignore/.gitted/description b/common/testdata/ignore/.gitted/description similarity index 100% rename from testdata/ignore/.gitted/description rename to common/testdata/ignore/.gitted/description diff --git a/testdata/ignore/.gitted/index b/common/testdata/ignore/.gitted/index similarity index 100% rename from testdata/ignore/.gitted/index rename to common/testdata/ignore/.gitted/index diff --git a/testdata/ignore/.gitted/info/refs b/common/testdata/ignore/.gitted/info/refs similarity index 100% rename from testdata/ignore/.gitted/info/refs rename to common/testdata/ignore/.gitted/info/refs diff --git a/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.idx b/common/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.idx similarity index 100% rename from testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.idx rename to common/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.idx diff --git a/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.pack b/common/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.pack similarity index 100% rename from testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.pack rename to common/testdata/ignore/.gitted/objects/pack/pack-6084461925de24b5672557d115a4eff8b2d92326.pack diff --git a/testdata/ignore/.gitted/packed-refs b/common/testdata/ignore/.gitted/packed-refs similarity index 100% rename from testdata/ignore/.gitted/packed-refs rename to common/testdata/ignore/.gitted/packed-refs diff --git a/testdata/ignore/.gitted/refs/heads/.gitignore b/common/testdata/ignore/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/ignore/.gitted/refs/heads/.gitignore rename to common/testdata/ignore/.gitted/refs/heads/.gitignore diff --git a/testdata/ignore/.gitted/refs/tags/.gitignore b/common/testdata/ignore/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/ignore/.gitted/refs/tags/.gitignore rename to common/testdata/ignore/.gitted/refs/tags/.gitignore diff --git a/testdata/ignore/1.md b/common/testdata/ignore/1.md similarity index 100% rename from testdata/ignore/1.md rename to common/testdata/ignore/1.md diff --git a/testdata/multiple_file_change/.gitted/COMMIT_EDITMSG b/common/testdata/multiple_file_change/.gitted/COMMIT_EDITMSG similarity index 100% rename from testdata/multiple_file_change/.gitted/COMMIT_EDITMSG rename to common/testdata/multiple_file_change/.gitted/COMMIT_EDITMSG diff --git a/testdata/multiple_file_change/.gitted/HEAD b/common/testdata/multiple_file_change/.gitted/HEAD similarity index 100% rename from testdata/multiple_file_change/.gitted/HEAD rename to common/testdata/multiple_file_change/.gitted/HEAD diff --git a/testdata/multiple_file_change/.gitted/branches/.gitignore b/common/testdata/multiple_file_change/.gitted/branches/.gitignore similarity index 100% rename from testdata/multiple_file_change/.gitted/branches/.gitignore rename to common/testdata/multiple_file_change/.gitted/branches/.gitignore diff --git a/testdata/multiple_file_change/.gitted/config b/common/testdata/multiple_file_change/.gitted/config similarity index 100% rename from testdata/multiple_file_change/.gitted/config rename to common/testdata/multiple_file_change/.gitted/config diff --git a/testdata/multiple_file_change/.gitted/description b/common/testdata/multiple_file_change/.gitted/description similarity index 100% rename from testdata/multiple_file_change/.gitted/description rename to common/testdata/multiple_file_change/.gitted/description diff --git a/testdata/multiple_file_change/.gitted/index b/common/testdata/multiple_file_change/.gitted/index similarity index 100% rename from testdata/multiple_file_change/.gitted/index rename to common/testdata/multiple_file_change/.gitted/index diff --git a/testdata/multiple_file_change/.gitted/info/refs b/common/testdata/multiple_file_change/.gitted/info/refs similarity index 100% rename from testdata/multiple_file_change/.gitted/info/refs rename to common/testdata/multiple_file_change/.gitted/info/refs diff --git a/testdata/multiple_file_change/.gitted/logs/HEAD b/common/testdata/multiple_file_change/.gitted/logs/HEAD similarity index 100% rename from testdata/multiple_file_change/.gitted/logs/HEAD rename to common/testdata/multiple_file_change/.gitted/logs/HEAD diff --git a/testdata/multiple_file_change/.gitted/logs/refs/heads/master b/common/testdata/multiple_file_change/.gitted/logs/refs/heads/master similarity index 100% rename from testdata/multiple_file_change/.gitted/logs/refs/heads/master rename to common/testdata/multiple_file_change/.gitted/logs/refs/heads/master diff --git a/testdata/multiple_file_change/.gitted/objects/info/commit-graph b/common/testdata/multiple_file_change/.gitted/objects/info/commit-graph similarity index 100% rename from testdata/multiple_file_change/.gitted/objects/info/commit-graph rename to common/testdata/multiple_file_change/.gitted/objects/info/commit-graph diff --git a/testdata/multiple_file_change/.gitted/objects/info/packs b/common/testdata/multiple_file_change/.gitted/objects/info/packs similarity index 100% rename from testdata/multiple_file_change/.gitted/objects/info/packs rename to common/testdata/multiple_file_change/.gitted/objects/info/packs diff --git a/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx b/common/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx similarity index 100% rename from testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx rename to common/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.idx diff --git a/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.pack b/common/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.pack similarity index 100% rename from testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.pack rename to common/testdata/multiple_file_change/.gitted/objects/pack/pack-8bd23478afc278bb9d444418db77fa24b756f8b8.pack diff --git a/testdata/multiple_file_change/.gitted/packed-refs b/common/testdata/multiple_file_change/.gitted/packed-refs similarity index 100% rename from testdata/multiple_file_change/.gitted/packed-refs rename to common/testdata/multiple_file_change/.gitted/packed-refs diff --git a/testdata/multiple_file_change/.gitted/refs/heads/.gitignore b/common/testdata/multiple_file_change/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/multiple_file_change/.gitted/refs/heads/.gitignore rename to common/testdata/multiple_file_change/.gitted/refs/heads/.gitignore diff --git a/testdata/multiple_file_change/.gitted/refs/tags/.gitignore b/common/testdata/multiple_file_change/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/multiple_file_change/.gitted/refs/tags/.gitignore rename to common/testdata/multiple_file_change/.gitted/refs/tags/.gitignore diff --git a/testdata/multiple_file_change/1.md b/common/testdata/multiple_file_change/1.md similarity index 100% rename from testdata/multiple_file_change/1.md rename to common/testdata/multiple_file_change/1.md diff --git a/testdata/multiple_file_change/dirA/2.md b/common/testdata/multiple_file_change/dirA/2.md similarity index 100% rename from testdata/multiple_file_change/dirA/2.md rename to common/testdata/multiple_file_change/dirA/2.md diff --git a/testdata/multiple_file_change/dirB/3.md b/common/testdata/multiple_file_change/dirB/3.md similarity index 100% rename from testdata/multiple_file_change/dirB/3.md rename to common/testdata/multiple_file_change/dirB/3.md diff --git a/testdata/new_file/.gitted/HEAD b/common/testdata/new_file/.gitted/HEAD similarity index 100% rename from testdata/new_file/.gitted/HEAD rename to common/testdata/new_file/.gitted/HEAD diff --git a/testdata/new_file/.gitted/branches/.gitignore b/common/testdata/new_file/.gitted/branches/.gitignore similarity index 100% rename from testdata/new_file/.gitted/branches/.gitignore rename to common/testdata/new_file/.gitted/branches/.gitignore diff --git a/testdata/new_file/.gitted/config b/common/testdata/new_file/.gitted/config similarity index 100% rename from testdata/new_file/.gitted/config rename to common/testdata/new_file/.gitted/config diff --git a/testdata/new_file/.gitted/description b/common/testdata/new_file/.gitted/description similarity index 100% rename from testdata/new_file/.gitted/description rename to common/testdata/new_file/.gitted/description diff --git a/testdata/new_file/.gitted/index b/common/testdata/new_file/.gitted/index similarity index 100% rename from testdata/new_file/.gitted/index rename to common/testdata/new_file/.gitted/index diff --git a/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx b/common/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx similarity index 100% rename from testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx rename to common/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx diff --git a/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack b/common/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack similarity index 100% rename from testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack rename to common/testdata/new_file/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack diff --git a/testdata/new_file/.gitted/packed-refs b/common/testdata/new_file/.gitted/packed-refs similarity index 100% rename from testdata/new_file/.gitted/packed-refs rename to common/testdata/new_file/.gitted/packed-refs diff --git a/testdata/new_file/.gitted/refs/heads/.gitignore b/common/testdata/new_file/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/new_file/.gitted/refs/heads/.gitignore rename to common/testdata/new_file/.gitted/refs/heads/.gitignore diff --git a/testdata/new_file/.gitted/refs/tags/.gitignore b/common/testdata/new_file/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/new_file/.gitted/refs/tags/.gitignore rename to common/testdata/new_file/.gitted/refs/tags/.gitignore diff --git a/testdata/new_file/1.md b/common/testdata/new_file/1.md similarity index 100% rename from testdata/new_file/1.md rename to common/testdata/new_file/1.md diff --git a/testdata/new_file/2.md b/common/testdata/new_file/2.md similarity index 100% rename from testdata/new_file/2.md rename to common/testdata/new_file/2.md diff --git a/testdata/no_changes/.gitted/HEAD b/common/testdata/no_changes/.gitted/HEAD similarity index 100% rename from testdata/no_changes/.gitted/HEAD rename to common/testdata/no_changes/.gitted/HEAD diff --git a/testdata/no_changes/.gitted/branches/.gitignore b/common/testdata/no_changes/.gitted/branches/.gitignore similarity index 100% rename from testdata/no_changes/.gitted/branches/.gitignore rename to common/testdata/no_changes/.gitted/branches/.gitignore diff --git a/testdata/no_changes/.gitted/config b/common/testdata/no_changes/.gitted/config similarity index 100% rename from testdata/no_changes/.gitted/config rename to common/testdata/no_changes/.gitted/config diff --git a/testdata/no_changes/.gitted/description b/common/testdata/no_changes/.gitted/description similarity index 100% rename from testdata/no_changes/.gitted/description rename to common/testdata/no_changes/.gitted/description diff --git a/testdata/no_changes/.gitted/index b/common/testdata/no_changes/.gitted/index similarity index 100% rename from testdata/no_changes/.gitted/index rename to common/testdata/no_changes/.gitted/index diff --git a/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx b/common/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx similarity index 100% rename from testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx rename to common/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx diff --git a/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack b/common/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack similarity index 100% rename from testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack rename to common/testdata/no_changes/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack diff --git a/testdata/no_changes/.gitted/packed-refs b/common/testdata/no_changes/.gitted/packed-refs similarity index 100% rename from testdata/no_changes/.gitted/packed-refs rename to common/testdata/no_changes/.gitted/packed-refs diff --git a/testdata/no_changes/.gitted/refs/heads/.gitignore b/common/testdata/no_changes/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/no_changes/.gitted/refs/heads/.gitignore rename to common/testdata/no_changes/.gitted/refs/heads/.gitignore diff --git a/testdata/no_changes/.gitted/refs/tags/.gitignore b/common/testdata/no_changes/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/no_changes/.gitted/refs/tags/.gitignore rename to common/testdata/no_changes/.gitted/refs/tags/.gitignore diff --git a/testdata/no_changes/1.md b/common/testdata/no_changes/1.md similarity index 100% rename from testdata/no_changes/1.md rename to common/testdata/no_changes/1.md diff --git a/testdata/one_file_change/.gitted/HEAD b/common/testdata/one_file_change/.gitted/HEAD similarity index 100% rename from testdata/one_file_change/.gitted/HEAD rename to common/testdata/one_file_change/.gitted/HEAD diff --git a/testdata/one_file_change/.gitted/branches/.gitignore b/common/testdata/one_file_change/.gitted/branches/.gitignore similarity index 100% rename from testdata/one_file_change/.gitted/branches/.gitignore rename to common/testdata/one_file_change/.gitted/branches/.gitignore diff --git a/testdata/one_file_change/.gitted/config b/common/testdata/one_file_change/.gitted/config similarity index 100% rename from testdata/one_file_change/.gitted/config rename to common/testdata/one_file_change/.gitted/config diff --git a/testdata/one_file_change/.gitted/description b/common/testdata/one_file_change/.gitted/description similarity index 100% rename from testdata/one_file_change/.gitted/description rename to common/testdata/one_file_change/.gitted/description diff --git a/testdata/one_file_change/.gitted/index b/common/testdata/one_file_change/.gitted/index similarity index 100% rename from testdata/one_file_change/.gitted/index rename to common/testdata/one_file_change/.gitted/index diff --git a/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx b/common/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx similarity index 100% rename from testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx rename to common/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx diff --git a/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack b/common/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack similarity index 100% rename from testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack rename to common/testdata/one_file_change/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack diff --git a/testdata/one_file_change/.gitted/packed-refs b/common/testdata/one_file_change/.gitted/packed-refs similarity index 100% rename from testdata/one_file_change/.gitted/packed-refs rename to common/testdata/one_file_change/.gitted/packed-refs diff --git a/testdata/one_file_change/.gitted/refs/heads/.gitignore b/common/testdata/one_file_change/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/one_file_change/.gitted/refs/heads/.gitignore rename to common/testdata/one_file_change/.gitted/refs/heads/.gitignore diff --git a/testdata/one_file_change/.gitted/refs/tags/.gitignore b/common/testdata/one_file_change/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/one_file_change/.gitted/refs/tags/.gitignore rename to common/testdata/one_file_change/.gitted/refs/tags/.gitignore diff --git a/testdata/one_file_change/1.md b/common/testdata/one_file_change/1.md similarity index 100% rename from testdata/one_file_change/1.md rename to common/testdata/one_file_change/1.md diff --git a/testdata/rebase_both_commits/.gitted/HEAD b/common/testdata/rebase_both_commits/.gitted/HEAD similarity index 100% rename from testdata/rebase_both_commits/.gitted/HEAD rename to common/testdata/rebase_both_commits/.gitted/HEAD diff --git a/testdata/rebase_both_commits/.gitted/branches/.gitignore b/common/testdata/rebase_both_commits/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_both_commits/.gitted/branches/.gitignore rename to common/testdata/rebase_both_commits/.gitted/branches/.gitignore diff --git a/testdata/rebase_both_commits/.gitted/config b/common/testdata/rebase_both_commits/.gitted/config similarity index 100% rename from testdata/rebase_both_commits/.gitted/config rename to common/testdata/rebase_both_commits/.gitted/config diff --git a/testdata/rebase_both_commits/.gitted/description b/common/testdata/rebase_both_commits/.gitted/description similarity index 100% rename from testdata/rebase_both_commits/.gitted/description rename to common/testdata/rebase_both_commits/.gitted/description diff --git a/testdata/rebase_both_commits/.gitted/index b/common/testdata/rebase_both_commits/.gitted/index similarity index 100% rename from testdata/rebase_both_commits/.gitted/index rename to common/testdata/rebase_both_commits/.gitted/index diff --git a/testdata/rebase_both_commits/.gitted/objects/57/79561afa9d074ae8d20974861c54757429aca9 b/common/testdata/rebase_both_commits/.gitted/objects/57/79561afa9d074ae8d20974861c54757429aca9 similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/57/79561afa9d074ae8d20974861c54757429aca9 rename to common/testdata/rebase_both_commits/.gitted/objects/57/79561afa9d074ae8d20974861c54757429aca9 diff --git a/testdata/rebase_both_commits/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 b/common/testdata/rebase_both_commits/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 rename to common/testdata/rebase_both_commits/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 diff --git a/testdata/rebase_both_commits/.gitted/objects/b8/626c4cff2849624fb67f87cd0ad72b163671ad b/common/testdata/rebase_both_commits/.gitted/objects/b8/626c4cff2849624fb67f87cd0ad72b163671ad similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/b8/626c4cff2849624fb67f87cd0ad72b163671ad rename to common/testdata/rebase_both_commits/.gitted/objects/b8/626c4cff2849624fb67f87cd0ad72b163671ad diff --git a/testdata/rebase_both_commits/.gitted/objects/bb/42c22f4d5ce6083275b82e129a4b7868913015 b/common/testdata/rebase_both_commits/.gitted/objects/bb/42c22f4d5ce6083275b82e129a4b7868913015 similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/bb/42c22f4d5ce6083275b82e129a4b7868913015 rename to common/testdata/rebase_both_commits/.gitted/objects/bb/42c22f4d5ce6083275b82e129a4b7868913015 diff --git a/testdata/rebase_both_commits/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/common/testdata/rebase_both_commits/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 rename to common/testdata/rebase_both_commits/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx b/common/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx rename to common/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.idx diff --git a/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack b/common/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack similarity index 100% rename from testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack rename to common/testdata/rebase_both_commits/.gitted/objects/pack/pack-5acce72f5df296705a9b2e13dc0581d7f0b26f96.pack diff --git a/testdata/rebase_both_commits/.gitted/packed-refs b/common/testdata/rebase_both_commits/.gitted/packed-refs similarity index 100% rename from testdata/rebase_both_commits/.gitted/packed-refs rename to common/testdata/rebase_both_commits/.gitted/packed-refs diff --git a/testdata/rebase_both_commits/.gitted/refs/heads/.gitignore b/common/testdata/rebase_both_commits/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_both_commits/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_both_commits/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_both_commits/.gitted/refs/tags/.gitignore b/common/testdata/rebase_both_commits/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_both_commits/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_both_commits/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_both_commits/1.md b/common/testdata/rebase_both_commits/1.md similarity index 100% rename from testdata/rebase_both_commits/1.md rename to common/testdata/rebase_both_commits/1.md diff --git a/testdata/rebase_both_commits/2.md b/common/testdata/rebase_both_commits/2.md similarity index 100% rename from testdata/rebase_both_commits/2.md rename to common/testdata/rebase_both_commits/2.md diff --git a/testdata/rebase_both_commits_conflict/.gitted/HEAD b/common/testdata/rebase_both_commits_conflict/.gitted/HEAD similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/HEAD rename to common/testdata/rebase_both_commits_conflict/.gitted/HEAD diff --git a/testdata/rebase_both_commits_conflict/.gitted/branches/.gitignore b/common/testdata/rebase_both_commits_conflict/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/branches/.gitignore rename to common/testdata/rebase_both_commits_conflict/.gitted/branches/.gitignore diff --git a/testdata/rebase_both_commits_conflict/.gitted/config b/common/testdata/rebase_both_commits_conflict/.gitted/config similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/config rename to common/testdata/rebase_both_commits_conflict/.gitted/config diff --git a/testdata/rebase_both_commits_conflict/.gitted/description b/common/testdata/rebase_both_commits_conflict/.gitted/description similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/description rename to common/testdata/rebase_both_commits_conflict/.gitted/description diff --git a/testdata/rebase_both_commits_conflict/.gitted/index b/common/testdata/rebase_both_commits_conflict/.gitted/index similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/index rename to common/testdata/rebase_both_commits_conflict/.gitted/index diff --git a/testdata/rebase_both_commits_conflict/.gitted/info/refs b/common/testdata/rebase_both_commits_conflict/.gitted/info/refs similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/info/refs rename to common/testdata/rebase_both_commits_conflict/.gitted/info/refs diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 b/common/testdata/rebase_both_commits_conflict/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/5b/2421e1ef4d7f32306709aab06b1a6c02294b30 diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/common/testdata/rebase_both_commits_conflict/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/info/commit-graph b/common/testdata/rebase_both_commits_conflict/.gitted/objects/info/commit-graph similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/info/commit-graph rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/info/commit-graph diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/info/packs b/common/testdata/rebase_both_commits_conflict/.gitted/objects/info/packs similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/info/packs rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/info/packs diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx b/common/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.idx diff --git a/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack b/common/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack rename to common/testdata/rebase_both_commits_conflict/.gitted/objects/pack/pack-fd52ab0ce127a1919ff8c45b06c172528a4e8fb7.pack diff --git a/testdata/rebase_both_commits_conflict/.gitted/packed-refs b/common/testdata/rebase_both_commits_conflict/.gitted/packed-refs similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/packed-refs rename to common/testdata/rebase_both_commits_conflict/.gitted/packed-refs diff --git a/testdata/rebase_both_commits_conflict/.gitted/refs/heads/.gitignore b/common/testdata/rebase_both_commits_conflict/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_both_commits_conflict/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_both_commits_conflict/.gitted/refs/tags/.gitignore b/common/testdata/rebase_both_commits_conflict/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_both_commits_conflict/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_both_commits_conflict/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_both_commits_conflict/1.md b/common/testdata/rebase_both_commits_conflict/1.md similarity index 100% rename from testdata/rebase_both_commits_conflict/1.md rename to common/testdata/rebase_both_commits_conflict/1.md diff --git a/testdata/rebase_both_commits_conflict/2.md b/common/testdata/rebase_both_commits_conflict/2.md similarity index 100% rename from testdata/rebase_both_commits_conflict/2.md rename to common/testdata/rebase_both_commits_conflict/2.md diff --git a/testdata/rebase_both_commits_conflict/3.md b/common/testdata/rebase_both_commits_conflict/3.md similarity index 100% rename from testdata/rebase_both_commits_conflict/3.md rename to common/testdata/rebase_both_commits_conflict/3.md diff --git a/testdata/rebase_local_commits/.gitted/HEAD b/common/testdata/rebase_local_commits/.gitted/HEAD similarity index 100% rename from testdata/rebase_local_commits/.gitted/HEAD rename to common/testdata/rebase_local_commits/.gitted/HEAD diff --git a/testdata/rebase_local_commits/.gitted/branches/.gitignore b/common/testdata/rebase_local_commits/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_local_commits/.gitted/branches/.gitignore rename to common/testdata/rebase_local_commits/.gitted/branches/.gitignore diff --git a/testdata/rebase_local_commits/.gitted/config b/common/testdata/rebase_local_commits/.gitted/config similarity index 100% rename from testdata/rebase_local_commits/.gitted/config rename to common/testdata/rebase_local_commits/.gitted/config diff --git a/testdata/rebase_local_commits/.gitted/description b/common/testdata/rebase_local_commits/.gitted/description similarity index 100% rename from testdata/rebase_local_commits/.gitted/description rename to common/testdata/rebase_local_commits/.gitted/description diff --git a/testdata/rebase_local_commits/.gitted/index b/common/testdata/rebase_local_commits/.gitted/index similarity index 100% rename from testdata/rebase_local_commits/.gitted/index rename to common/testdata/rebase_local_commits/.gitted/index diff --git a/testdata/rebase_local_commits/.gitted/info/refs b/common/testdata/rebase_local_commits/.gitted/info/refs similarity index 100% rename from testdata/rebase_local_commits/.gitted/info/refs rename to common/testdata/rebase_local_commits/.gitted/info/refs diff --git a/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.idx b/common/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.idx similarity index 100% rename from testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.idx rename to common/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.idx diff --git a/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.pack b/common/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.pack similarity index 100% rename from testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.pack rename to common/testdata/rebase_local_commits/.gitted/objects/pack/pack-6ed5aab84549686dd1639003c49f7f7aede63325.pack diff --git a/testdata/rebase_local_commits/.gitted/packed-refs b/common/testdata/rebase_local_commits/.gitted/packed-refs similarity index 100% rename from testdata/rebase_local_commits/.gitted/packed-refs rename to common/testdata/rebase_local_commits/.gitted/packed-refs diff --git a/testdata/rebase_local_commits/.gitted/refs/heads/.gitignore b/common/testdata/rebase_local_commits/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_local_commits/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_local_commits/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_local_commits/.gitted/refs/tags/.gitignore b/common/testdata/rebase_local_commits/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_local_commits/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_local_commits/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_local_commits/1.md b/common/testdata/rebase_local_commits/1.md similarity index 100% rename from testdata/rebase_local_commits/1.md rename to common/testdata/rebase_local_commits/1.md diff --git a/testdata/rebase_local_commits/2.md b/common/testdata/rebase_local_commits/2.md similarity index 100% rename from testdata/rebase_local_commits/2.md rename to common/testdata/rebase_local_commits/2.md diff --git a/testdata/rebase_nothing/.gitted/FETCH_HEAD b/common/testdata/rebase_nothing/.gitted/FETCH_HEAD similarity index 100% rename from testdata/rebase_nothing/.gitted/FETCH_HEAD rename to common/testdata/rebase_nothing/.gitted/FETCH_HEAD diff --git a/testdata/rebase_nothing/.gitted/HEAD b/common/testdata/rebase_nothing/.gitted/HEAD similarity index 100% rename from testdata/rebase_nothing/.gitted/HEAD rename to common/testdata/rebase_nothing/.gitted/HEAD diff --git a/testdata/rebase_nothing/.gitted/branches/.gitignore b/common/testdata/rebase_nothing/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_nothing/.gitted/branches/.gitignore rename to common/testdata/rebase_nothing/.gitted/branches/.gitignore diff --git a/testdata/rebase_nothing/.gitted/config b/common/testdata/rebase_nothing/.gitted/config similarity index 100% rename from testdata/rebase_nothing/.gitted/config rename to common/testdata/rebase_nothing/.gitted/config diff --git a/testdata/rebase_nothing/.gitted/description b/common/testdata/rebase_nothing/.gitted/description similarity index 100% rename from testdata/rebase_nothing/.gitted/description rename to common/testdata/rebase_nothing/.gitted/description diff --git a/testdata/rebase_nothing/.gitted/index b/common/testdata/rebase_nothing/.gitted/index similarity index 100% rename from testdata/rebase_nothing/.gitted/index rename to common/testdata/rebase_nothing/.gitted/index diff --git a/testdata/rebase_nothing/.gitted/logs/refs/remotes/origin/master b/common/testdata/rebase_nothing/.gitted/logs/refs/remotes/origin/master similarity index 100% rename from testdata/rebase_nothing/.gitted/logs/refs/remotes/origin/master rename to common/testdata/rebase_nothing/.gitted/logs/refs/remotes/origin/master diff --git a/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx b/common/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx similarity index 100% rename from testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx rename to common/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx diff --git a/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack b/common/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack similarity index 100% rename from testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack rename to common/testdata/rebase_nothing/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack diff --git a/testdata/rebase_nothing/.gitted/packed-refs b/common/testdata/rebase_nothing/.gitted/packed-refs similarity index 100% rename from testdata/rebase_nothing/.gitted/packed-refs rename to common/testdata/rebase_nothing/.gitted/packed-refs diff --git a/testdata/rebase_nothing/.gitted/refs/heads/.gitignore b/common/testdata/rebase_nothing/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_nothing/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_nothing/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_nothing/.gitted/refs/remotes/origin/master b/common/testdata/rebase_nothing/.gitted/refs/remotes/origin/master similarity index 100% rename from testdata/rebase_nothing/.gitted/refs/remotes/origin/master rename to common/testdata/rebase_nothing/.gitted/refs/remotes/origin/master diff --git a/testdata/rebase_nothing/.gitted/refs/tags/.gitignore b/common/testdata/rebase_nothing/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_nothing/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_nothing/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_nothing/1.md b/common/testdata/rebase_nothing/1.md similarity index 100% rename from testdata/rebase_nothing/1.md rename to common/testdata/rebase_nothing/1.md diff --git a/testdata/rebase_parent/.gitted/HEAD b/common/testdata/rebase_parent/.gitted/HEAD similarity index 100% rename from testdata/rebase_parent/.gitted/HEAD rename to common/testdata/rebase_parent/.gitted/HEAD diff --git a/testdata/rebase_parent/.gitted/branches/.gitignore b/common/testdata/rebase_parent/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_parent/.gitted/branches/.gitignore rename to common/testdata/rebase_parent/.gitted/branches/.gitignore diff --git a/testdata/rebase_parent/.gitted/config b/common/testdata/rebase_parent/.gitted/config similarity index 100% rename from testdata/rebase_parent/.gitted/config rename to common/testdata/rebase_parent/.gitted/config diff --git a/testdata/rebase_parent/.gitted/description b/common/testdata/rebase_parent/.gitted/description similarity index 100% rename from testdata/rebase_parent/.gitted/description rename to common/testdata/rebase_parent/.gitted/description diff --git a/testdata/rebase_parent/.gitted/index b/common/testdata/rebase_parent/.gitted/index similarity index 100% rename from testdata/rebase_parent/.gitted/index rename to common/testdata/rebase_parent/.gitted/index diff --git a/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.idx b/common/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.idx similarity index 100% rename from testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.idx rename to common/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.idx diff --git a/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.pack b/common/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.pack similarity index 100% rename from testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.pack rename to common/testdata/rebase_parent/.gitted/objects/pack/pack-0e97b284249125dd68802efc8e497badec0ab786.pack diff --git a/testdata/rebase_parent/.gitted/packed-refs b/common/testdata/rebase_parent/.gitted/packed-refs similarity index 100% rename from testdata/rebase_parent/.gitted/packed-refs rename to common/testdata/rebase_parent/.gitted/packed-refs diff --git a/testdata/rebase_parent/.gitted/refs/heads/.gitignore b/common/testdata/rebase_parent/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_parent/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_parent/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_parent/.gitted/refs/tags/.gitignore b/common/testdata/rebase_parent/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_parent/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_parent/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_parent/1.md b/common/testdata/rebase_parent/1.md similarity index 100% rename from testdata/rebase_parent/1.md rename to common/testdata/rebase_parent/1.md diff --git a/testdata/rebase_parent/3.md b/common/testdata/rebase_parent/3.md similarity index 100% rename from testdata/rebase_parent/3.md rename to common/testdata/rebase_parent/3.md diff --git a/testdata/rebase_remote_commits/.gitted/HEAD b/common/testdata/rebase_remote_commits/.gitted/HEAD similarity index 100% rename from testdata/rebase_remote_commits/.gitted/HEAD rename to common/testdata/rebase_remote_commits/.gitted/HEAD diff --git a/testdata/rebase_remote_commits/.gitted/branches/.gitignore b/common/testdata/rebase_remote_commits/.gitted/branches/.gitignore similarity index 100% rename from testdata/rebase_remote_commits/.gitted/branches/.gitignore rename to common/testdata/rebase_remote_commits/.gitted/branches/.gitignore diff --git a/testdata/rebase_remote_commits/.gitted/config b/common/testdata/rebase_remote_commits/.gitted/config similarity index 100% rename from testdata/rebase_remote_commits/.gitted/config rename to common/testdata/rebase_remote_commits/.gitted/config diff --git a/testdata/rebase_remote_commits/.gitted/description b/common/testdata/rebase_remote_commits/.gitted/description similarity index 100% rename from testdata/rebase_remote_commits/.gitted/description rename to common/testdata/rebase_remote_commits/.gitted/description diff --git a/testdata/rebase_remote_commits/.gitted/index b/common/testdata/rebase_remote_commits/.gitted/index similarity index 100% rename from testdata/rebase_remote_commits/.gitted/index rename to common/testdata/rebase_remote_commits/.gitted/index diff --git a/testdata/rebase_remote_commits/.gitted/info/refs b/common/testdata/rebase_remote_commits/.gitted/info/refs similarity index 100% rename from testdata/rebase_remote_commits/.gitted/info/refs rename to common/testdata/rebase_remote_commits/.gitted/info/refs diff --git a/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx b/common/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx similarity index 100% rename from testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx rename to common/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.idx diff --git a/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack b/common/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack similarity index 100% rename from testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack rename to common/testdata/rebase_remote_commits/.gitted/objects/pack/pack-6c99d95700f1ca8eaa8f19957b0c70a80a1d0b72.pack diff --git a/testdata/rebase_remote_commits/.gitted/packed-refs b/common/testdata/rebase_remote_commits/.gitted/packed-refs similarity index 100% rename from testdata/rebase_remote_commits/.gitted/packed-refs rename to common/testdata/rebase_remote_commits/.gitted/packed-refs diff --git a/testdata/rebase_remote_commits/.gitted/refs/heads/.gitignore b/common/testdata/rebase_remote_commits/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/rebase_remote_commits/.gitted/refs/heads/.gitignore rename to common/testdata/rebase_remote_commits/.gitted/refs/heads/.gitignore diff --git a/testdata/rebase_remote_commits/.gitted/refs/tags/.gitignore b/common/testdata/rebase_remote_commits/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/rebase_remote_commits/.gitted/refs/tags/.gitignore rename to common/testdata/rebase_remote_commits/.gitted/refs/tags/.gitignore diff --git a/testdata/rebase_remote_commits/1.md b/common/testdata/rebase_remote_commits/1.md similarity index 100% rename from testdata/rebase_remote_commits/1.md rename to common/testdata/rebase_remote_commits/1.md diff --git a/testdata/simple_fetch/.gitted/HEAD b/common/testdata/simple_fetch/.gitted/HEAD similarity index 100% rename from testdata/simple_fetch/.gitted/HEAD rename to common/testdata/simple_fetch/.gitted/HEAD diff --git a/testdata/simple_fetch/.gitted/branches/.gitignore b/common/testdata/simple_fetch/.gitted/branches/.gitignore similarity index 100% rename from testdata/simple_fetch/.gitted/branches/.gitignore rename to common/testdata/simple_fetch/.gitted/branches/.gitignore diff --git a/testdata/simple_fetch/.gitted/config b/common/testdata/simple_fetch/.gitted/config similarity index 100% rename from testdata/simple_fetch/.gitted/config rename to common/testdata/simple_fetch/.gitted/config diff --git a/testdata/simple_fetch/.gitted/description b/common/testdata/simple_fetch/.gitted/description similarity index 100% rename from testdata/simple_fetch/.gitted/description rename to common/testdata/simple_fetch/.gitted/description diff --git a/testdata/simple_fetch/.gitted/index b/common/testdata/simple_fetch/.gitted/index similarity index 100% rename from testdata/simple_fetch/.gitted/index rename to common/testdata/simple_fetch/.gitted/index diff --git a/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx b/common/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx similarity index 100% rename from testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx rename to common/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.idx diff --git a/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack b/common/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack similarity index 100% rename from testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack rename to common/testdata/simple_fetch/.gitted/objects/pack/pack-64633f8b9e2cb3a97cffd48edac3655d0fe90419.pack diff --git a/testdata/simple_fetch/.gitted/packed-refs b/common/testdata/simple_fetch/.gitted/packed-refs similarity index 100% rename from testdata/simple_fetch/.gitted/packed-refs rename to common/testdata/simple_fetch/.gitted/packed-refs diff --git a/testdata/simple_fetch/.gitted/refs/heads/.gitignore b/common/testdata/simple_fetch/.gitted/refs/heads/.gitignore similarity index 100% rename from testdata/simple_fetch/.gitted/refs/heads/.gitignore rename to common/testdata/simple_fetch/.gitted/refs/heads/.gitignore diff --git a/testdata/simple_fetch/.gitted/refs/tags/.gitignore b/common/testdata/simple_fetch/.gitted/refs/tags/.gitignore similarity index 100% rename from testdata/simple_fetch/.gitted/refs/tags/.gitignore rename to common/testdata/simple_fetch/.gitted/refs/tags/.gitignore diff --git a/testdata/simple_fetch/1.md b/common/testdata/simple_fetch/1.md similarity index 100% rename from testdata/simple_fetch/1.md rename to common/testdata/simple_fetch/1.md diff --git a/watch.go b/common/watch.go similarity index 98% rename from watch.go rename to common/watch.go index 758951a..f4b9414 100644 --- a/watch.go +++ b/common/watch.go @@ -1,4 +1,4 @@ -package main +package common import ( "fmt" diff --git a/daemon.go b/daemon.go index 7d75144..2326e17 100644 --- a/daemon.go +++ b/daemon.go @@ -7,6 +7,7 @@ import ( "path/filepath" "strings" + "github.com/GitJournal/git-auto-sync/common" cli "github.com/urfave/cli/v2" "github.com/ztrue/tracerr" git "gopkg.in/src-d/go-git.v4" @@ -19,7 +20,7 @@ func daemonStatus(ctx *cli.Context) error { } func daemonList(ctx *cli.Context) error { - config, err := ReadConfig() + config, err := common.ReadConfig() if err != nil { return tracerr.Wrap(err) } @@ -46,13 +47,13 @@ func daemonAdd(ctx *cli.Context) error { return tracerr.Wrap(err) } - config, err := ReadConfig() + config, err := common.ReadConfig() if err != nil { return tracerr.Wrap(err) } config.Repos = append(config.Repos, repoPath) - err = WriteConfig(config) + err = common.WriteConfig(config) if err != nil { return tracerr.Wrap(err) } @@ -89,7 +90,7 @@ func daemonRm(ctx *cli.Context) error { repoPath = filepath.Join(cwd, repoPath) } - config, err := ReadConfig() + config, err := common.ReadConfig() if err != nil { return tracerr.Wrap(err) } @@ -108,7 +109,7 @@ func daemonRm(ctx *cli.Context) error { } config.Repos = remove(config.Repos, pos) - err = WriteConfig(config) + err = common.WriteConfig(config) if err != nil { return tracerr.Wrap(err) } diff --git a/main.go b/main.go index 29a8b85..d0fa95d 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,8 @@ import ( "github.com/gen2brain/beeep" cli "github.com/urfave/cli/v2" "github.com/ztrue/tracerr" + + "github.com/GitJournal/git-auto-sync/common" ) func main() { @@ -23,7 +25,7 @@ func main() { return tracerr.Wrap(err) } - return WatchForChanges(repoPath) + return common.WatchForChanges(repoPath) }, }, { @@ -35,7 +37,7 @@ func main() { return tracerr.Wrap(err) } - err = autoSync(repoPath) + err = common.AutoSync(repoPath) if err != nil { return tracerr.Wrap(err) }