History

refactor

Sebastian Thiel committed 5 years ago

Commit a4d5f991 parent 11018e18 files · +26 −26Browse files

Showing the changes to git-object/src/mutable (1 of 8 files). Show all

Unified · Split

git-object/src/mutable/tree.rs+4−4
@@ -1,4 +1,4 @@
1use crate::{mutable::SPACE, tree::Mode};1use crate::{mutable::SPACE, tree::EntryMode};
2use bstr::{BString, ByteSlice};2use bstr::{BString, ByteSlice};
3use quick_error::quick_error;3use quick_error::quick_error;
4use std::cmp::Ordering;4use std::cmp::Ordering;
@@ -34,7 +34,7 @@ pub struct Tree { · 29 unmodified lines
34#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]34#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
35pub struct Entry {35pub struct Entry {
36 /// The kind of object to which `oid` is pointing to.36 /// The kind of object to which `oid` is pointing to.
37 pub mode: Mode,37 pub mode: EntryMode,
38 /// The name of the file in the parent tree.38 /// The name of the file in the parent tree.
39 pub filename: BString,39 pub filename: BString,
40 /// The id of the object representing the entry.40 /// The id of the object representing the entry.
@@ -56,10 +56,10 @@ impl Ord for Entry { · 15 unmodified lines
56}56}
57 57
58/// Serialization58/// Serialization
59impl Mode {59impl EntryMode {
60 /// Return the representation as used in the git internal format.60 /// Return the representation as used in the git internal format.
61 pub fn as_bytes(&self) -> &'static [u8] {61 pub fn as_bytes(&self) -> &'static [u8] {
62 use Mode::*;62 use EntryMode::*;
63 match self {63 match self {
64 Tree => b"40000",64 Tree => b"40000",
65 Blob => b"100644",65 Blob => b"100644",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t