File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ public static class Utilities
2626 /// <summary>StableSwarmUI's current version.</summary>
2727 public static readonly string Version = Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version . ToString ( ) ;
2828
29+ /// <summary>Current git commit (if known -- empty if unknown).</summary>
30+ public static string GitCommit = "" ;
31+
2932 /// <summary>Used by linked pages to prevent cache errors when data changes.</summary>
3033 public static string VaryID = Version ;
3134
@@ -39,6 +42,11 @@ public static class Utilities
3942
4043 static Utilities ( )
4144 {
45+ if ( File . Exists ( "./.git/refs/heads/master" ) )
46+ {
47+ GitCommit = File . ReadAllText ( "./.git/refs/heads/master" ) . Trim ( ) [ 0 ..8 ] ;
48+ VaryID += ".GIT-" + GitCommit ;
49+ }
4250 for ( int i = 0 ; i <= 9 ; i ++ )
4351 {
4452 ReservedFilenames . Add ( $ "com{ i } ") ;
You can’t perform that action at this time.
0 commit comments