mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
refactor: git version related commands
* use `--pathspec-from-file=<FILE>` in `git add` command if git >= 2.25.0 * use `--pathspec-from-file=<FILE>` in `git stash push` command if git >= 2.26.0 * use `--staged` in `git stash push` command only if git >= 2.35.0
This commit is contained in:
parent
c939308e4c
commit
b26838ff68
10 changed files with 306 additions and 103 deletions
25
src/Models/GitVersions.cs
Normal file
25
src/Models/GitVersions.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
namespace SourceGit.Models
|
||||
{
|
||||
public static class GitVersions
|
||||
{
|
||||
/// <summary>
|
||||
/// The minimal version of Git that required by this app.
|
||||
/// </summary>
|
||||
public static readonly System.Version MINIMAL = new System.Version(2, 23, 0);
|
||||
|
||||
/// <summary>
|
||||
/// The minimal version of Git that supports the `add` command with the `--pathspec-from-file` option.
|
||||
/// </summary>
|
||||
public static readonly System.Version ADD_WITH_PATHSPECFILE = new System.Version(2, 25, 0);
|
||||
|
||||
/// <summary>
|
||||
/// The minimal version of Git that supports the `stash` command with the `--pathspec-from-file` option.
|
||||
/// </summary>
|
||||
public static readonly System.Version STASH_WITH_PATHSPECFILE = new System.Version(2, 26, 0);
|
||||
|
||||
/// <summary>
|
||||
/// The minimal version of Git that supports the `stash` command with the `--staged` option.
|
||||
/// </summary>
|
||||
public static readonly System.Version STASH_ONLY_STAGED = new System.Version(2, 35, 0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue