| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Allow checking out a worktree using a tag hash id.
Fixes: https://github.com/go-git/go-git/issues/959
Supersedes: https://github.com/go-git/go-git/pull/964
|
|
|
|
|
|
|
|
| |
Some worktree validation rules observed upstream are not checked
by go-git, leading to scenarios in which what seems to be a valid
repository for go-git is not necessarily the case for the git cli.
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces the option to set a FS for alternates, enabling more flexible cross FS
sharing of alternates. If none is set, falls back to the current FS used for the
object storage.
The changes only process a given path once, and if an alternates dir is not valid,
exits with error - aligning behaviour with upstream.
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
|
|\
| |
| | |
git: stop iterating at oldest shallow when pulling. Fixes #305
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
Check reference names format before creating branches/tags/remotes.
This should probably be in a lower level somewhere in `plumbing`.
Validating the names under `plumbing.NewReference*` is not possible
since these functions don't return errors.
Fixes: https://github.com/go-git/go-git/issues/929
|
|
|
|
|
|
|
|
|
|
| |
If we have all what we asked for, finish the session and handle error.
This is equivalent of git "Already up to date." message.
Fixes: https://github.com/go-git/go-git/issues/328
Fixes: https://github.com/go-git/go-git/issues/638
Fixes: https://github.com/go-git/go-git/issues/157
|
|
|
|
| |
Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|\
| |
| | |
git: worktree, add check to see if file already checked in. Fixes #718
|
| |
| |
| |
| | |
Checks if an ignored file was previously checked in. If it was, then the file is not ignored matching native git behavior.
|
|/
|
|
|
|
| |
Perform grep on `*Repository` instead of `*Worktree`.
Fixes: https://github.com/go-git/go-git/issues/68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The TestPullAdd test uses git CLI to perform a commit.
Contributors with signing enabled globally would have their GPG
configuration being used to sign that test commit.
This behaviour was transparent for contributors that do not use
secure keys which requires physical confirmation.
The new behaviour disables GPG signing for that test, which was
not required as part of the test.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
|
|
| |
When we delete dir1/dir2/file1, we currently check if dir2 becomes
empty with the deletion of file1, and if so, we delete dir2. If
dir1 becomes empty with the deletion of dir2, we don't notice that,
and dir1 is left behind.
This commit adds a loop to check each parent directory in the file
path for emptiness, removing empty directories along the way until
a non-empty directory is found (or an error occurs).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BuildTree now returns an ErrEmptyCommit error, when there are no
changes to be committed. This can be opted-out via
CommitOptions.AllowEmptyCommits.
This is a breaking change which enables applications to detect when
empty commits are to be created.
Some instances in which this can occur is when the fs (e.g. `billy/osfs`)
make changes to the underlying files, causing a conflict between what
the previous Git worktree state was, and the current state. Changes to
the fs implementations are orthogonal to this, and will be dealt with
separately.
The new behaviour aligns with the Git CLI, in which empty commits
returns the error message: 'nothing to commit, working tree clean'.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|\
| |
| | |
Remove unused vars/types/funcs/fields
|
| |
| |
| |
| |
| |
| |
| |
| | |
[staticcheck](https://staticcheck.io/) reported a number of unused
fields, functions, types, and variables across the code.
Where possible, use them (assert unchecked errors in tests, for example)
and otherwise remove them.
|
|/
|
|
|
|
|
|
|
| |
This is the initial logic to support a simple sparse checkout where
directories to be included can be specified in CheckoutOptions.
This change doesn't fully support the sparse patterns, nor does this
change include the optimization to collapse flie entries in ithe index
that are excluded via the sparse checkout directory patterns included
under the parent directory.
|
| |
|
|
|
|
|
|
|
| |
When using a separate worktree directory while working on a bare
repository, cleaning with CleanOptions{Dir: true} would also remove the
root worktree directory if empty.
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the current behavior, the config will always hold the resolved,
absolute URL, leavin the user of go-git no choice to determine whether
the original URL is relative or not.
This changes to employ relative URL resolution only when resolving
a submodule to a repository to keep the correct configuration
'unresolved' and intact.
Change relative resolution using `filepath.Dir` to `path.Join` while
parsing both the 'root' and the relative URL with `net/url.URL`.
Adapt test to verify the new behavior.
Re-fixes #184 (see comments).
|
| |
|
|
|
|
|
|
|
| |
If you run 'git pull', do a commit and run 'git pull' again git will
report "Already up to date" whereas go-git would report a reports
non-fast-forward update. This commit changes the behavior of go-git to
match that of git.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Git creates `.git/commondir` when there are custom worktrees (see "git worktree add" related commands).
`.git/commondir` in such case contains a link to another dot-git repository tree, which could contain some folders like:
- objects;
- config;
- refs;
- etc.
In this PR a new dotgit.RepositoryFilesystem struct is defined, which is billy.Filesystem interface compatible object-wrapper, that can handle commondir and dispatch all operations to the correct file path.
`git.PlainOpen` remain unchanged, but `git.PlainOpenWithOptions` has a new option: `PlainOpenOptions.EnableDotGitCommonDir=true|false` (which is false by default). When `EnableDotGitCommonDir=true` repository-open procedure will read `.git/commondir` (if it exists) and then create dotgit.RepositoryFilesystem object initialized with 2 filesystems. This object then passed into storage and then into dotgit.DotGit as `billy.Filesystem` interface. This object will catch all filesystem operations and dispatch to the correct repository-filesystem (dot-git or common-dot-git) according to the rules described in the doc: https://git-scm.com/docs/gitrepository-layout#Documentation/gitrepository-layout.txt. EnableDotGitCommonDir option will only work with the filesystem-backed storage.
Also worktree_test.go has been adopted from an older, already existing existing PR: https://github.com/src-d/go-git/pull/1098. This PR needs new fixtures added in the following PR: https://github.com/go-git/go-git-fixtures/pull/1.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
No need to convert these values, they're already of the right type.
Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com>
(cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
|
|
|
|
|
|
|
|
|
|
| |
When we assign a value to err, make sure to also check for it being nil
afterwards. If those were intentionally unchecked, we should remove the
assignment in the first place. Those checks certainly never harm, but please
review thoroughly and let me know.
Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com>
(cherry picked from commit 19d6f42a4d814a50bd262fbb69a9b670db9756a2)
|
|
|
|
| |
Signed-off-by: Linuxer Wang <linuxerwang@gmail.com>
|
|
|
|
| |
Signed-off-by: Fabian Sabau <fabian.sabau+git@gmail.com>
|
|\
| |
| | |
Remove Unicode normalization in difftree
|
| |
| |
| |
| |
| |
| | |
Fixes #1057
Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
|
|/
|
|
| |
Signed-off-by: Alexey Smirnov <unlinkat@gmail.com>
|
|
|
|
| |
Signed-off-by: kuba-- <kuba@sourced.tech>
|
|
|
| |
Worktree: Provide ability to add excludes
|
|
|
|
| |
Signed-off-by: kuba-- <kuba@sourced.tech>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|\
| |
| | |
git: Worktree.Grep() support multiple patterns and pathspecs
|
| |
| |
| |
| | |
Signed-off-by: Sunny <me@darkowlzz.space>
|
|/
|
|
|
|
| |
- no unnecessary err/bool check, uses them directly
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
|
|
|
| |
This change implemented grep on worktree with options to invert match and specify pathspec. Also, a commit hash or reference can be used to specify the worktree to search.
|