forked from sourcegit-scm/sourcegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitIgnoreFile.cs
More file actions
26 lines (22 loc) · 795 Bytes
/
GitIgnoreFile.cs
File metadata and controls
26 lines (22 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Collections.Generic;
using System.IO;
using Avalonia.Media;
namespace SourceGit.Models
{
public class GitIgnoreFile
{
public static readonly List<GitIgnoreFile> Supported = [new(true), new(false)];
public bool IsShared { get; set; }
public string File => IsShared ? ".gitignore" : "<git_dir>/info/exclude";
public string Desc => IsShared ? "Shared" : "Private";
public IBrush Brush => IsShared ? Brushes.Green : Brushes.Gray;
public GitIgnoreFile(bool isShared)
{
IsShared = isShared;
}
public string GetFullPath(string repoPath, string gitDir)
{
return IsShared ? Path.Combine(repoPath, ".gitignore") : Path.Combine(gitDir, "info", "exclude");
}
}
}