Revision 91dcdfd3b5331d955cfb60edf8930f1b5c142905 authored by Linus Torvalds on 12 July 2005, 03:44:20 UTC, committed by Linus Torvalds on 12 July 2005, 03:44:20 UTC
In particular, if we check out something that isn't an old branch, it
now requires a new branch-name to check the thing out into.

So, for example:

	git checkout -b my-branch v2.6.12

will create the new branch "my-branch", and start it at v2.6.12, while

	git checkout master

will just switch back to the master branch.

Of course, if you want to create a new branch "my-branch" and _not_
check it out, you could have done so with just

	git-rev-parse v2.6.12^0 > .git/refs/heads/my-branch

which I think I will codify as "git branch".
1 parent 714fff2
Raw File
tree.h
#ifndef TREE_H
#define TREE_H

#include "object.h"

extern const char *tree_type;

struct tree_entry_list {
	struct tree_entry_list *next;
	unsigned directory : 1;
	unsigned executable : 1;
	unsigned symlink : 1;
	unsigned int mode;
	char *name;
	union {
		struct tree *tree;
		struct blob *blob;
	} item;
	struct tree_entry_list *parent;
};

struct tree {
	struct object object;
	struct tree_entry_list *entries;
};

struct tree *lookup_tree(const unsigned char *sha1);

int parse_tree_buffer(struct tree *item, void *buffer, unsigned long size);

int parse_tree(struct tree *tree);

#endif /* TREE_H */
back to top