Skip to content

Commit 33ca535

Browse files
committed
Added GitStatus.
1 parent 1cf9a0a commit 33ca535

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) Scott Doxey. All Rights Reserved. Licensed under the MIT License. See LICENSE in the project root for license information.
2+
3+
#if UNITY_EDITOR
4+
using System;
5+
using UnityEditor;
6+
7+
namespace CandyCoded.GitStatus
8+
{
9+
10+
[InitializeOnLoad]
11+
public static class GitStatus
12+
{
13+
14+
public static string branch;
15+
16+
public static string[] branches;
17+
18+
public static string[] changedFiles;
19+
20+
public static string[] untrackedFiles;
21+
22+
public static string[] lockedFiles;
23+
24+
public static DateTime lastUpdated;
25+
26+
static GitStatus()
27+
{
28+
29+
FileWatcher.UpdateEvent -= Update;
30+
FileWatcher.UpdateEvent += Update;
31+
32+
Update();
33+
34+
}
35+
36+
public static void Update()
37+
{
38+
39+
branch = Git.Branch();
40+
41+
branches = Git.Branches();
42+
43+
changedFiles = Git.ChangedFiles();
44+
45+
untrackedFiles = Git.UntrackedFiles();
46+
47+
lockedFiles = Git.LockedFiles();
48+
49+
lastUpdated = DateTime.Now;
50+
51+
}
52+
53+
}
54+
55+
}
56+
#endif

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/GitStatus.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)