Skip to content

Commit 44d2c81

Browse files
committed
Added GitStatus.
1 parent d3f2db6 commit 44d2c81

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 DateTime lastUpdated;
23+
24+
static GitStatus()
25+
{
26+
27+
FileWatcher.UpdateEvent -= Update;
28+
FileWatcher.UpdateEvent += Update;
29+
30+
Update();
31+
32+
}
33+
34+
public static void Update()
35+
{
36+
37+
branch = Git.Branch();
38+
39+
branches = Git.Branches();
40+
41+
changedFiles = Git.ChangedFiles();
42+
43+
untrackedFiles = Git.UntrackedFiles();
44+
45+
lastUpdated = DateTime.Now;
46+
47+
}
48+
49+
}
50+
51+
}
52+
#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)