repo git: Create size store files when they don't exist yet
This commit is contained in:
parent
f9c60cbd39
commit
4e0dff6956
|
@ -98,8 +98,12 @@ namespace Sparkles.Git {
|
|||
get {
|
||||
string file_path = Path.Combine (LocalPath, ".git", "info", "size");
|
||||
|
||||
if (!File.Exists (file_path))
|
||||
File.WriteAllText (file_path, "0");
|
||||
|
||||
string size = File.ReadAllText (file_path);
|
||||
|
||||
try {
|
||||
string size = File.ReadAllText (file_path);
|
||||
return double.Parse (size);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -114,8 +118,12 @@ namespace Sparkles.Git {
|
|||
get {
|
||||
string file_path = Path.Combine (LocalPath, ".git", "info", "history_size");
|
||||
|
||||
if (!File.Exists (file_path))
|
||||
File.WriteAllText (file_path, "0");
|
||||
|
||||
string size = File.ReadAllText (file_path);
|
||||
|
||||
try {
|
||||
string size = File.ReadAllText (file_path);
|
||||
return double.Parse (size);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in a new issue