コード例 #1
0
		public TreeEntry (byte[] mode, string name, SHA1 id)
		{
			if (id.Bytes.Length != 20)
				throw new ArgumentException (String.Format
				                             ("The size of the SHA1 is incorrect, tree entry is invalid has to be 20 and is: ", 
				                              id.Bytes.Length));
			
			if (String.IsNullOrEmpty (name))
				throw new ArgumentException ("Name is null, tree entry is invalid");
			
			if (mode.Length < 5)
				throw new ArgumentException ("mode size is incorrect, tree entry is invalid, size has to be longer than 5 or 5");
			
			this.mode = new GitFileMode (mode);
			this.name = name;
			this.id = id;
		}
コード例 #2
0
		public SymlinkTreeEntry (Tree myParent, SHA1 objId, string objName, bool exec) : 
			base (myParent, objId, objName)
		{
			mode = GitFileMode.Symlink;
		}
コード例 #3
0
		public void SetExecutable (bool setExec)
		{
			mode = setExec ? GitFileMode.ExecutableFile : GitFileMode.RegularFile;
		}