Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Use git-for-each-ref to check whether the origin branch exists.
author
Stephan Springl
<springl-git@bfw-online.de>
Wed, 23 May 2007 11:13:21 +0000
(12:13 +0100)
committer
Junio C Hamano
<junkio@cox.net>
Wed, 23 May 2007 18:06:38 +0000
(11:06 -0700)
This works in repositories that have their refs packed by
"git-pack-refs --all --prune" whereas testing the file
$git_dir/refs/heads/$opt_o does not.
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c80e07d
)
diff --git
a/git-cvsimport.perl
b/git-cvsimport.perl
index ac74bc51b3197d06f13f588d6916400ac3e6fcf0..f68afe78a0a0ea4997b8988f241cd3a675d785f9 100755
(executable)
--- a/
git-cvsimport.perl
+++ b/
git-cvsimport.perl
@@
-559,11
+559,6
@@
($$)
$last_branch = $opt_o;
$orig_branch = "";
} else {
$last_branch = $opt_o;
$orig_branch = "";
} else {
- -f "$git_dir/refs/heads/$opt_o"
- or die "Branch '$opt_o' does not exist.\n".
- "Either use the correct '-o branch' option,\n".
- "or import to a new repository.\n";
-
open(F, "git-symbolic-ref HEAD |") or
die "Cannot run git-symbolic-ref: $!\n";
chomp ($last_branch = <F>);
open(F, "git-symbolic-ref HEAD |") or
die "Cannot run git-symbolic-ref: $!\n";
chomp ($last_branch = <F>);
@@
-588,6
+583,11
@@
($$)
$branch_date{$head} = $1;
}
close(H);
$branch_date{$head} = $1;
}
close(H);
+ if (!exists $branch_date{$opt_o}) {
+ die "Branch '$opt_o' does not exist.\n".
+ "Either use the correct '-o branch' option,\n".
+ "or import to a new repository.\n";
+ }
}
-d $git_dir
}
-d $git_dir