summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4faac24)
raw | patch | inline | side by side (parent: 4faac24)
author | Matthias Lederhofer <matled@gmx.net> | |
Sun, 3 Jun 2007 14:46:36 +0000 (16:46 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Jun 2007 23:07:53 +0000 (16:07 -0700) |
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-parse.txt | patch | blob | history | |
builtin-rev-parse.c | patch | blob | history | |
git-sh-setup.sh | patch | blob | history | |
git-svn.perl | patch | blob | history |
index 5fcec19a5616527228e3a7bd45a8d0b6fdb0b86c..c817d1614af01a11d60e50ab73f41ed2575f3d4a 100644 (file)
When the current working directory is below the repository
directory print "true", otherwise "false".
+--is-bare-repository::
+ When the repository is bare print "true", otherwise "false".
+
--short, --short=number::
Instead of outputting the full SHA1 values of object names try to
abbreviate them to a shorter unique name. When no length is specified
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 37addb25fafbedba9bad6e99746ee65bacdee7d3..71d51625957ac7851be9a528ed561158ae9f7f93 100644 (file)
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
: "false");
continue;
}
+ if (!strcmp(arg, "--is-bare-repository")) {
+ printf("%s\n", is_bare_repository() ? "true"
+ : "false");
+ continue;
+ }
if (!prefixcmp(arg, "--since=")) {
show_datestring("--max-age=", arg+8);
continue;
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index f24c7f2d23c13e9874308a019f3c0f93225de3c0..9ac657a70e67315f46a0c42611d7e6d78f538031 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
}
is_bare_repository () {
- git-config --bool --get core.bare ||
- case "$GIT_DIR" in
- .git | */.git) echo false ;;
- *) echo true ;;
- esac
+ git-rev-parse --is-bare-repository
}
cd_to_toplevel () {
diff --git a/git-svn.perl b/git-svn.perl
index e35006142af766080b3bafe0cdcd39bf2ccf3f04..e3a5cbb3d752b6a6dacac404115f3ed9d9bd6115 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my $index = $ENV{GIT_INDEX_FILE} || "$ENV{GIT_DIR}/index";
return if -f $index;
- chomp(my $bare = `git config --bool --get core.bare`);
- return if $bare eq 'true';
+ return if command_oneline(qw/rev-parse --is-bare-repository/) eq 'true';
return if command_oneline(qw/rev-parse --is-inside-git-dir/) eq 'true';
command_noisy(qw/read-tree -m -u -v HEAD HEAD/);
print STDERR "Checked out HEAD:\n ",